This document contains an automatic ftp script to upload/backup files to a remote ftp server.
You can schedule this script to use this as a simple backup solution.
Installing the ftp client:
yum install ftp
Ftp script to upload files:
#!/bin/sh
USERNAME=”ftp-user-name”
PASSWORD=”ftp-password”
SERVER=”ftp.server.address”# local directory
FILE=”/backup”# remote server directory
BACKUPDIR=”/backup”# login to remote server
ftp -n -i $SERVER <<EOF
user $USERNAME $PASSWORDcd $BACKUPDIR
lcd $FILEmput *.*
quit
EOF
Make sure script has executable permissions:
#chmod +x /path/to/ftp.backup.script.sh
Setup a cronjob to run the script at 19:30 everyday:
30 19 * * * /path/to/backup.script.sh