Tuncay Sahin

ICT Engineer | Docent ICT & Trainer

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 $PASSWORD

cd $BACKUPDIR
lcd $FILE

mput *.*

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

Meer informatie

Voor meer informatie of voor een persoonlijk adviesgesprek kunt u altijd vrijblijvend contact met mij opnemen.

E-Mail

info@tuncaysahin.nl