On Wed Oct 13, 2004 at 09:39:12 +1000, Alexander Samad wrote:
Just a suggestion why not use scp
Alex
On Wed, Oct 13, 2004 at 09:17:29AM +1000, Voytek Eymont wrote:
I have a simple backup script like:
cd /home
for i in *.* ; do echo 'now processing' $i tar cfz $i.tar.gz /home/$i echo 'finished processing' $i done
----- at completion, I'd like to login to ftp and mput *.gz; how do I script ftp user/pass/commands ?
Well reading the man page for my ftp program you just specify these on the command line:
ftp user:[EMAIL PROTECTED],
but I just realised that was the man page on a bsd box, standard linux ftp program doesn't appear to support that.
lftp appears to support something similar though.
Cheers,
Benno
You can "script" ftp by using an input file instead of stdin. The logon can be automated with .netrc (man netrc). For example:
Sample .netrc machine ftp.some.domain login someuser password somepassword
Now setup an ftp script file, for example ftp_script might contain: ls disconnect bye
Now execute
# ftp ftp.some.domain < ftp_script
This would output a listing of the base folder on the ftp site and then disconnect and exit ftp back to the shell. No interaction.
Fil -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
