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 and whm

Discussion in 'Data Protection' started by sniperscope, Aug 20, 2011.

  1. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Hi
    Recently i installed Rsync and i want backup everything (accounts, mails, databases..etc) in WHM.
    How can i do that?

    Regards
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    In WHM, you can use WHM > Backup > Configure Backup to backup accounts, databases and even configuration files (if you are using local backups). For FTP, you can back up accounts and databases. WHM doesn't use rsync for these backups, so I'm uncertain what rsync would have in relation to performing WHM-based backups.
     
  3. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    It depends where you where you want to backup data to, and how you want to use the backup data.

    WHM > Backup > Configure Backup lets you configure sending per-cpanel-account-archives to a remote FTP server that you can restore in emergency cases from within WHM.

    Rsync works fine if you have a second WHM/Cpanel Server. Remember to exclude everything from rsyncing that is not a cpanel user (especially refrain from backing up /home/virtfs, since that can severely mess up the second server).

    As of 'databases' in case you are thinking of mySQL databases, mysqld has to be stopped before you replicate the data with e.g. mysqldump. You could also replicate data "life" to the second server. It depends on what you need there.
     
  4. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    I solved problem as below
    first i set up back in whm and then used rsync transfer to safe place.
    However, i am worry about whm settings.

    If something happen can i recover everything such as dns entries, third party software etc.?
     
  5. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    If you look for assistance in this forum, please be more exact.

    You say: " i set up back in whm"
    - Where and what did you set up (which menu item did you use)?
    - Which options did you choose?

    You say: then used rsync transfer to safe place.
    - what means safe place? Is it a second whm/cpanel server or a remote ftp or whatever?
    - to understand what you did, please write down your rsync command !

    You say: ... about whm settings can i recover everything such as dns entries, third party software etc.?
    - you can certainly not backup 'everything' with rsync.
    - also, rsync will not backup your mysql databases.
     
  6. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    Dear Zombo

    I set up in WHM Main >> Backup >> Configure Backup
    My Options are follow:
    Backup Status : Enable
    Backup Interval: Everyday
    Backup Retention: Daily Weekly (Check boxes checked )
    Days to Run Backup: Checked everyday
    Remount/Unmount Backup Drive: Disable
    Bail Out If Backup Drive Mount Fails: Disable
    Incremental Backup: Enable
    Backup Accounts: Enable
    Compress Account Backups: Enable
    Backup Configuration Files: Enable
    Backup SQL Databases: Per Account and Entire MySQL Directory
    Backup Access Logs: Disable
    Use local DNS zone files....: Disable
    Backup Type: Standard
    EXPERIMENTAL: Use Hard: Disable
    EXPERIMENTAL: Enable use of optimized account backup tool.: Disable
    Remote FTP Host: Blank
    FTP Backup User: Blank
    FTP Backup Password: Blank
    FTP Backup Directory: Blank
    FTP Backup Passive Mode: Enable(i guess this should be disable but anyway..)
    Backup Destination: /backup


    Safe Place means: Safe place, Not in cPanel or WHM or not in current server.

    Rsync command is : rsync -av /backup/cpbackup/ root@somesafeplace_addr:/home/backup/

    In this case: i back up entire MySQL databases and Entire Accounts, Mail accounts, Files, Folders everything(it was 1.9gb) and run above command.

    It seems, i solved my problem for now.
     
  7. zombo

    zombo Active Member

    Joined:
    Jan 28, 2004
    Messages:
    38
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Austria
    if you prefer rsync to ftp then you could add the -z option (compress file data during the transfer) as well as --delete after (receiver deletes files after transfer, not before) to save on bandwidth and added safety.

    So in case you do not need encrypted transfer and your whm backup is created in backup/cpbackup you could use

    sync -avz --delete-after /backup/cpbackup/ root@somesafeplace_addr:/home/backup/

    I would try to restore a not-so important account at least once to be sure the backup works when you need it.

    This does, however, not backup or any of the "whm-options" you mentioned. They are spread over various locations on the server, e.g. /var, /etc, /usr/local/cpanel ... it would though not work to simply restore them in case of trouble. You could only compare their values to find out differences.
     
    #7 zombo, Sep 5, 2011
    Last edited: Sep 5, 2011
  8. sniperscope

    sniperscope Well-Known Member

    Joined:
    Apr 5, 2011
    Messages:
    118
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    osaka/ japan
    cPanel Access Level:
    Website Owner
    What i great suggestion. I even didn't think about it.
    Thanks for remind this valuable suggestion.
     
Loading...

Share This Page