Create a .netrc file in your home directory containing this info
machine your_remote_servername_or_IP_address_here
login your_user_name_here
password users_password_here
macdef init
mput *
bye
chmod 600 .netrc # File MUST have this permissions set to work.
See man ftp and man netrc for more info on syntax of .netrc
Next write a script ftpbackup.sh containing theese three lines.
#!/usr/bin/ksh
cd /u1/TEST
ftp your_remote_hostname_or_IP_address_here
chmod u+x ftpbackup.sh # Set execute right on the script
add this script to cron
crontab -l >cronfile (list your crontable if you already are running
cron jobs and puts it in the file cronfile)
echo "0 9 * * * /home/yourehomedir/ftpbackup.sh >/tmp/ftpbackup.log
2>&1" >> cronfile # Run at 9.00 everyday.
crontab cronfile # Adds the new cronfile to cron
/H?kanen
> Hi,
> I need to run the following scripts at 9:00PM every day,
> cd /u1/TEST
> ftp -i 123.145.100.17
> after I open a ftp session
> I need to type in login name and password and then I need to type:
> mput * manually each time each day to copy all the files in /u1/TEST
> to my Windows NT server's related directory.
> Richard