If you’re on a linux host, you might find this useful. It will backup all the websites for a given user on the host into an archive folder that you can download regularly. This script runs weekly on my host, and backs up my dozen or so sites and databases. You’ll need a shell user probably, and the ability to set up CRON jobs.
In the root directory of your account, above the web root, create a folder called backup, and inside that create another folder called archive.
CHMOD those sufficiently for your shell user to write to, probably 755 is good.
In the backup folder, place two files — domain.sh, and mysql.sh:
domain.sh:
mysql.sh:
for database in $databases
do
echo "Processing database $database"
mysqldump –opt -u[user] -p[pass] -h [server] ${database} > mysql/${database}.$suffix.sql
done
tar -cf archives/mysql_backup.$suffix.tar mysql/*
rm -r mysql/
Make sure those files are in the right format — if you’re on a windows machine, FTPing into your linux server, and if you try running them and get a hard time, try using the dos2unix utility via the shell on them to convert the characters.
Try running both of those files on the command line, to make sure they don’t error out. You should see a zip for each of your sites in the archive folder, plus one zip containing the database dumps for all your databases. If you do, then move on.
CRON jobs are just scheduled tasks on a linux machine. You can set them up to execute at any interval you want. Most hosting companies have simple CRON interfaces now so you don’t have to futz around with the actual text files. If you do have to futz, and you need help, here’s a CRON tutorial.
Set up two CRON jobs to run each backup script at a low traffic time. I run mine at midnight on Saturday. You can run your more or less frequently, and at whatever time you want.
This step isn’t necessary to get your backups working, but it may improve your life or mood.