> ftp remote_site
> but then how do I pass the cd, cp etc commands to ftp?
Ok. First, edit your .netrc file (in hour home dir)
and add something like:
thehostidumpto login yourlognamethere password yourpasswdthere
make sure that .netrc has mode 600
chmod 600 .netrc
When you execute
your will automatically be logged in. This is necessary
because ftp will always prompt the controlling terminal
for a username and password otherwize.
Once you've done that, you can list the commands you
in a file, say `ftp_commands'. Then when you
ftp thehostidumpto < ftp_commands
The commands will get executed.
To do this in the background in a cron sort of way,
you should detach from the controlling terminal by
redirecting both input and output. With bash use:
ftp thehostidumpto < ftp_commands > ftp_logfile 2>&1
When used with cron, make sure to specify full path
names for both ftp and the files. Also make sure to
execute the cron job from the user for which you set
up the .netrc file.
Brian F. G. Bidulock, P. Eng.,
Group Leader - Innovation Center
Bell Emergis - Sonaris