A little script to send a backup file to a remote FTP server:
#!/bin/bash
HOST='123.111.123.111'
USER='bak_user'
PASSWD='OpEnSeSaMe'
TODAY="$(date +"%Y%m%d")"
FILENAME=Hostname_$TODAY.tgz
cd /var/backup/sched/
ftp -n -v $HOST << EOT
ascii
user $USER $PASSWD
prompt
cd backups
put $FILENAME
ls -la
bye
EOT
Then run it every day from Cron.
Bash Shell Script to Automate FTP File Transfer
Leave a Reply