The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

rsync backup setup question

Discussion in 'General Discussion' started by salvatore333, Jun 9, 2010.

  1. salvatore333

    salvatore333 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    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 xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab

    echo "0 3 * * * root rsync -avz -e ssh /var xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab

    echo "0 3 * * * root rsync -avz -e ssh /usr/local/cpanel xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab

    echo "0 3 * * * root rsync -avz -e ssh /etc xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab

    echo "0 3 * * * root rsync -avz -e ssh /root xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab
     
  2. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    DataCenter Provider
    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.
     
  3. salvatore333

    salvatore333 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  4. garrettp

    garrettp Well-Known Member
    PartnerNOC

    Joined:
    Jun 18, 2004
    Messages:
    312
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  5. salvatore333

    salvatore333 Well-Known Member

    Joined:
    Mar 27, 2003
    Messages:
    233
    Likes Received:
    0
    Trophy Points:
    16
    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 xxxxxxxx@backup3.xxxxxxxx.com:server1_daily" >> /etc/crontab



    Thanks again for helping me.
     
  6. syslint

    syslint Well-Known Member

    Joined:
    Oct 9, 2006
    Messages:
    249
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    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 )
     
Loading...

Share This Page