If you have a WHM/cPanel based server, then you probably already have a daily backup running that keeps daily, weekly and monthly backups in another folder. But this does not help if the server disappears - you also need an offsite backup and Amazons S3 is perfect for this.
The good news is that there already exists a 'hook' that is run after an cPanel backup that we can use to do this.
Note: The functionality already exists to FTP backups to an external FTP server.
First you need to set up backups in WHM
Now we need to write our hook script. SSH into your server as root.
touch /scripts/postcpbackup
chmod +x /scripts/postcpbackup
vim /scripts/postcpbackup
add these lines. You will need to get your amazon keys and setup a target bucket from the AWS site
export AWS_ACCESS_KEY_ID=xxx export AWS_SECRET_ACCESS_KEY=xxx s3sync -v -r --delete /backup/cpbackup/daily/ bucketname:daily/
And all done.
You can manually run the backup with
/scripts/cpbackup
and check that it has synchronised your daily backup to the S3 bucket when finished.
As a final note,
Use this link to get DropBox http://db.tt/iQHWaaF