For those using cPanel, here’s a basic backup script nzgeoff posted at the VPS.NET clients-only forums.
This script will create individual tar.gz backups of all your cPanel user accounts and upload them to your S3 bucket. It won’t delete the local backups until the next time the scripts runs.
This script requires php-cli and the aws perl script from http://timkay.com/aws/
Here are the steps:
yum install curl curl github.com/timkay/aws/raw/master/aws -o aws perl aws --install
Now put your AWS credentials in
~/.awssecret: the Access Key ID on the first line and the Secret Access Key on the second line like this:
Open up nano on your server and create a file eg
/root/backups/backup.php and copy the following code.
Just change your email address (
$emailaddy) and bucket name (
$s3bucket) into your own and you're done.
Open up your crontab by running
crontab -eand paste the following code. In this example the backup script will run daily at 3am.0 3 * * * root php /root/backups/backup.php
A nice, clean, easy and efficient way to backup your cPanel userdata to Amazon S3.