Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: grandma on July 12, 2011, 07:48:31 PM
-
I tried typing
FTP and ftp
at a prompt - nothing...
then tried installing coreutils and repeating this
nothing...
Does TC include an ftp command line that is scriptable - i.e. the way DOS operates works like this
a) develop a ftp script such as myquick.ftp
ftp
myusername
mypassword
bi
cd afolder
send afile.txt
bye
b) then a bat file called doftp.bat
REM ONE LINE BAT FILE
ftp /s myquick.ftp
and ftp will automatically grab the contents in the ftp script file and execute
I'm sure linux can do this - thought it was in coreutils or busybox - but got no response (not found) when executed
-
There is no 'ftp' client in the Core, but serveral CLI extensions (e.g. 'cftp.tcz', 'inetutils.tcz' and 'lftp.tcz') exists that contain one.
I'm not so sure about the scripting support for the first two options, but 'lftp' looks quite flexible in this regard as these three little samples here demonstrate:tc@box:~$ echo 'get latest' | lftp ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux
tc@box:~$ ls -l latest ; cat latest
-rw-r--r-- 1 tc staff 6 Jul 3 06:30 latest
3.7.1
tc@box:~$ rm -f latest
tc@box:~$ lftp -c get ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux/latest
tc@box:~$ ls -l latest ; cat latest
-rw-r--r-- 1 tc staff 6 Jul 3 06:30 latest
3.7.1
tc@box:~$ rm -f latest
tc@box:~$ echo 'open ftp://distro.ibiblio.org/pub/linux/distributions/tinycorelinux' > lftp_cmds
tc@box:~$ echo 'get latest' >> lftp_cmds
tc@box:~$ lftp -f lftp_cmds
tc@box:~$ ls -l latest ; cat latest
-rw-r--r-- 1 tc staff 6 Jul 3 06:30 latest
3.7.1
-
In addition to the extensions that maro pointed out, Tiny Core base includes "ftpput" and "ftpget" which are scriptable. If you just type those commands in a terminal window and press enter it will display the syntax for the commands.
-
using inetutils
ftp -inv <script & {see: ftp --help}
where script (a plain text file) contains:
open ftp.domain.com
user mylogin mypasswd
lcd /path-to-my-local-dir
send myfile
bye
quit
-
TC uses busybox for a lot of commmands. The ftp command in busybox is tftp
-
TC uses busybox for a lot of commmands. The ftp command in busybox is tftp
Tiny Core base includes a TFTP server and client, however TFTP and FTP are different protocols and are not compatible with each other (i.e. you can't use a tftp client to connect to an ftp server)
-
In case you need secure ftp there is also Openssh which gives you ssh and sftp.
-
you gents are great - thank you - the inetutils example seems to be the closest I am used to
as for ssh methods - I will try them - always wished I had that - but many ftp clients don't support it - perhaps eventually I can use that on our server...
-
hi grandma,
ssh is really one of the most important connection tools:
just play around to connect to a server, than start to transfer files and later begin to tunnel different ports and services through unscecure environments like the internet... perhaps additionally secured by fail2ban.
it's amazing how endless are the opportunities of ssh and it's tools.
perhaps you give it a try, but there are some further interesting tools that base on or include the ssh framework:
f.e.
rsync to sync files or whole systems on different hosts
unison a gui tool that does the same thing in mixed environments with win, mac and linux
rsnapshot to get snapshots of your data plus something like a history of different versions.
sshfs to avoid poorly secured samba- or nfs-server-configurations
and so on.
give it a try, it' s really worth!