rsync backup setup question

salvatore333

Well-Known Member
Mar 27, 2003
229
0
166
I purchased rsync backup from a 3rd party provider. They suggest I backup the below 5 folders and NOT the backup drive cpbackup folder for the easiest and quickest way to recover from a cpanel server disaster. Is this correct? It's set to run automatically at 3AM every night obviously. There are only 4 websites on this server totaling about 10GB of space including all folders below.


echo "0 3 * * * root rsync -avz -e ssh /home [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /var [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /usr/local/cpanel [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /etc [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /root [email protected]:server1_daily" >> /etc/crontab
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
I purchased rsync backup from a 3rd party provider. They suggest I backup the below 5 folders and NOT the backup drive cpbackup folder for the easiest and quickest way to recover from a cpanel server disaster. Is this correct? It's set to run automatically at 3AM every night obviously. There are only 4 websites on this server totaling about 10GB of space including all folders below.


echo "0 3 * * * root rsync -avz -e ssh /home [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /var [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /usr/local/cpanel [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /etc [email protected]:server1_daily" >> /etc/crontab

echo "0 3 * * * root rsync -avz -e ssh /root [email protected]:server1_daily" >> /etc/crontab
It's up to you to determine what your tolerance level for failure is. The method mentioned above will require manual restoration of each of those directories in the event of a failure. You'll quickly find it very difficult to extract a single account from that type of backup should you need to. In addition, they are missing some key directories including:

/usr/share/ssl
/usr/local/apache

There may be others depending on any customizations you have made but including those should be sufficient to allow for a fairly seamless server restore.

cPanel account archives are probably easier, however, as you can restore them right through the WHM after reinstalling the OS+cPanel, as opposed to having to use rsync and running through cPanel's "fixer" scripts to clean up.
 

salvatore333

Well-Known Member
Mar 27, 2003
229
0
166
My main objective with the rsync backups are to restore the 4 websites that are on the server in case of a disaster. In the event of a disaster I would most likely get a new server that already has cpanel provisioned on it and would just need to restore the 4 websites which include databases and ssl certificates.

Can you please guide me as to the best way to setup the rsync to use to backup and restore in the event of an emergency?


Thank you very much for your response.
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
Best way is to use the cPanel backups. Store them locally on a backup drive or copy them to a local storage server as needed.
 

salvatore333

Well-Known Member
Mar 27, 2003
229
0
166
So since the server has a second drive I use as "/backup" and it is setup that way in the configure backup section of web host manager, I should simply setup a cron job like this?


echo "0 3 * * * root rsync -avz -e ssh /backup [email protected]:server1_daily" >> /etc/crontab



Thanks again for helping me.
 

syslint

Well-Known Member
Verifed Vendor
Oct 9, 2006
268
7
168
India
cPanel Access Level
Root Administrator
Twitter
I also prefer to chose only cPanel compatible backups. So you can easily restore it. If you are going to do it as remote backups , make sure your accounts will be small. ( Not good to do remote ftp backup for very big cpanel accounts )