Automtic FTP FTP

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: ShawnT.Rutledgerutledge@cx47646-a.phnx1.az.home.com
Date:  
Subject: Automtic FTP FTP
On Fri, Jun 02, 2000 at 11:53:45AM -0700, Ryan Denke wrote:
> I'm looking for a way to set up a cron job run a shell scriptto
> automatically connect to another server, login with username and
> password, and download the same file every day.
>
> I've read the man pages for FTP, but it just doesn't seem that you can
> pass it username, password, and get commands and make it all work.
> Anyone have any idea or suggestions?


I see the other solutions but to use ftp itself,

1.) make a .netrc file in the home directory of the user the command
runs as. Even a cron job runs as some user, the same user who created
the cron job.

2.) pipe the commands into ftp. For example:

ftp -i host.com < /home/me/ftp-script

where ftp-script is a plain text file like this:

cd directory
lcd local-directory
mput *

The -i means don't ask for each file when doing an mput.
-- 
  _______                   Shawn T. Rutledge / KB7PWD  
 (_  | |_)          http://www.bigfoot.com/~ecloud  
 __) | | \________________________________________________________________
Get money for spare CPU cycles at http://www.ProcessTree.com/?sponsor=5903