We have several websites at multiple hosting companies (all shared hosts - some using cPanel, others using Plesk) and we're looking for a way to backup all files and MySQL databases for each site. We'd like nightly or more frequent backups and prefer that it is completely automated.

My current plan is to store all the backups on an Amazon S3 account or similar. But I'm not sure what tools are out there to accomplish the collection and transfer of the files and databases. It would be nice if there's a way to do everything through a centralized management system, but that's not an absolute requirement.

Any help or suggestions would be greatly appreciated!

  • cPanel backup is covered here: webmasters.stackexchange.com/questions/16475/… Would it be OK for any tool to pull down the data and then push to S3 or do you want it to all happen "in the cloud"? Feb 8, 2012 at 16:49
  • Thanks for the reply @paulmorriss. (1) I saw that link before I asked my question, but there really wasn't a great answer in that one. (2) I don't have a problem with pulling the data down and they pushing it to S3, but I want it to be an automated process.
    – WebDevKev
    Feb 8, 2012 at 20:28

3 Answers 3


to backup your schema in MySql you can do:

mysqldump -u root -p [schema-name]  > backup.sql

to backup your files:

tar cvfz site_backup.tar.gz [folder to back-up]

and if you really want to make it automatic - create a shell script that creates daily backups with rotation - and call your script from cron.

  • 1
    For small sites this works pretty well. Make sure you have enough free space for your account before running these and gzip the mysqldump output file for speedier ftp transfer. For the automation, winscp can be automated to go retrieve a file and delete it. Have the website do the backups on a cron schedule and then have winscp go look for the results and pull them off. Mar 4, 2012 at 18:01

I've a dozen sites on Hostgator Centos shared hosting.

I've written a shell script which I placed in crontab which runs at 3am and backups mysql db of all sites, compresses it and email it to rotating gmail or hotmail account. And weekly or so I take full cpanel backups on my hotfile.com account.

If it isn't Ecommerce or so site then this'd suffice.


Hello there is a PHP script doing what you need : Website 2 Backup It has many features, but the most important for your needs :

  • Backup files and databases
  • Avoid shared web hosting limitations (maximum execution time, limitation of upload size)
  • Backup to Amazon S3
  • Incremental files backup to use less space on storage
  • Automated recovery of files and databases from Amazon S3 without files manipulation.
  • 3
    You really should disclose when you are promoting your own software
    – John Conde
    Feb 19, 2012 at 21:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.