Automated backups of selected databases and folders

Steve B

New Member
I have had a look in the tutorials section above but the threads there seem to deal with BQbackup or Amazon S3 and besides that don't mention database dumps and backup rotation. If I have missed one with information in there applicable to my query then I apologise in advance and hope you'll point me in the right direction :)

On to my issue...

I would like to set up a daily automated backup routine that will do a full database dump of some databases belonging to one of the accounts on my VPS and also the contents from one folder belonging to the same account. These should then be transferred from the VPS here to a second VPS that I have just for backups. The backups from the one folder can be incremental but the DB’s should be a full dump from each day so that I always have more than one DB backup available in case of issues.

Once the DB backups cover the last 7 days I would then like the newest backup to overwrite the oldest on the backup server, always leaving me with just 7 days worth of DB backups and the one, constant up to date copy of the folder. All of this should be fully automated requiring no human intervention.

I submitted a ticket enquiring if this was possible but the response was mainly to give me instructions on setting up automated backups for one account in WHM. Obviously that doesn’t meet my requirements to just backup selected databases and one folder, plus it takes no account of rotating the backups on the remote server.

So my question is can the above be done automatically with the software already installed on my VPS and if so, how would I go about getting this set up and running?

Any help is greatly welcomed.
Hello Steve,

If you only want to use software already on your VPS then you're pretty much limited to using MySQL commands. This page seems to have a decent tutorial you could look at. You would have to come up with your own script to do the rotation and everything though.

I personally use phpMyBackupPro which, even though it hasn't been updated in quite a while, works very well for me. It has been a long time since I set it up but I seem to remember that I put the files into an account's public_html folder and accessed it to configure it. Then after that I simply moved it to it's own folder and now run it with a command in cron. You can have it store backups for N days and N copies. Can have it FTP them although I just store them locally and then upload them in my regular backups. There are of course many other options to achieve this, if you want to look at some others I suggest looking at

If you run full backups and FTP them to your other VPS then it will include all the databases and all the account's data and that is probably what support was recommending that you do. In order for cPanel backups to work incrementally though you have to leave a copy of the backup on the local machine which would be why I do not do it that way. If you only want one folder backed up and you want it done incrementally I believe the command you will want is rsync. I am not an rsync guru but there is a great deal of info on it's use available online and perhaps someone else here on the forums will have some input.
Thanks for the reply and links Dan

I should probably have written free software rather than software on the server, thankfully your reply has given me the extra information and I think that using RSync is probably what I am looking for.

I’ll do some Google searches on its usage and see if I can figure out how if it can do what I need.

Thanks for pointing me in the right direction :)