TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:16121] automated ftp session?



Steve Paltzer wrote:
> 
> Hello all,
> 
> I have a file on a remote server that I would like to transfer to another
> server on a daily basis. Do you know how I could automate FTP to do this, or is
> their a better more efficient way to do this?
> 
> Thank you,
> -Steve
> 

You could just cron up a simple shell script using the plain-old ftp:

ftp -n <<-+++
   open $FTP_HOST
   user $FTP_USER
   get <remote file> <local file>
   put <local file> <remote file>
   quit
+++

Or else you can use a newer ftp, such as lftp:

lftp -f script_file

Where script file should look like this:

open -u <user_name>,<password>
get <remote_file> <local_file>
mirror <remote_dir>
close

lftp has a lot of nice features like mirror.

-- 
Clay Fandre
Twin Cities Linux Users Group
http://www.mn-linux.org