Below is a problem I have already solved but I am not capable of scripting the solution to.
I am getting better with Linux every day but I am not at the stage yet where I can script the solution (see solution section below).
I have googled the pants off this, and it seems that having a failover backup from live dedicated host (WHM / cpanel) to bachup dedicated host (with high availability) is not as easy as some are suggesting (eg. rsync all files etc).
Fail option 1) Rsync-ing all files in the home directory incrementally is great for website and email folder updates but does not contain databases (mounted / active, rsync will not work for this).
Fail option 2) Rsync-ing the daily backup files that WHM can generate is crap as it is a full transfer of data each time (no incrementals). I have over 110GB on 35 accounts due mainly to email and media data.
Fail option 3) Could try to use fail option 1 above then script each database to mirror between servers (too messy and fragile)
Solution (This should work):
The live WHM server already generates the standard daily backups of all cpanel accounts.
I need a script that will do the following:
1) Un-compress these backup tars to a temporary sync location (and the homedir tars within each tar)
2) Then use Rsync for it's fantastic incremental sync ability to transfer this uncompressed data to the backup WHM server.
3) Then script the backup WHM server to tar this data up again (including homedir tars within the main backup tars)
4) Then script the backup WHM server to import these backups (cpbackup) over the top of the existing accounts (terminate first?)
End result will be this:
If my main dedicated server blows up, all current data to the night before is not only safe, but ready to go live as soon as the domain name servers can propogate to the backup server. I want to do this rather than simply move backups off site and have the hastle of setting up a new server from scratch to restore the data to in a catastrophic situation where the live WHM server is FUBAR.
Can anyone help me write a script for the above?
I can take care of the SSH key so we can script it all from one server.
1) All of this would happen nightly (otherwise it is too much load on the server if 110GB (and growing) of accounts are backed up more often).
2) No attempt to sync backwards from backup to live is to be made (I would manually do this after an emergency if needed
3) Needs to log succesful updates and errors.
I can either offer a return favour of some sort or even pay to get this done, give me an idea of what this is worth to you if you can do it.
DO IT Solutions
Edited by DJRmenace, 07 August 2013 - 11:05 PM.