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.

WHM Backup Questions - Best Practices

Discussion in 'Data Protection' started by jethrodesign, Jul 24, 2012.

  1. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Hi, we have a VPS with HostGator that has about 30-40 client cPanel accounts currently. Host Gator does weekly offsite backups of our entire VPS container, but we really need to be backing up the individual accounts so if/when our clients destroy their sites we can help recover. I looked at the documentation, but it's pretty basic. Host Gator was no help unfortunately.

    Our VPS has about 45GB out of 60GB free. But it has crashed once or twice over the last many months, so we're very concerned about not over-taxing the system by running backups.

    So I just have some questions about best practices in setting up 'Main>>Backup>>Configure Backup' in WHM.

    1) For now, we would like to just backup to a directory on the root of our VPS. Will choosing '/backups' do this? Is there any way in WHM/cPanel to access this directory to copy the backup files to our local systems?

    2) The defaults are to do Weekly backups on Tues/Thurs/Sat. Will this give us 3 different backups each week (essentially every-other-day)? Should this be sufficient if our sites don't change that often?

    3) What are the pros/cons to doing Incremental Backups? Is everything backed up (including databases) and it works really solid? Since our sites don't change often, we would think this would be smart, just want to make sure it is reliable and doesn't tax our system any more.

    4) Pros/cons to compressing Account Backups?

    5) I'm assuming we would want to backup our SQL Databases as 'Per Account', but is there a good reason to do both Per Account and Entire MySQL Directory?

    6) How reliable are the two 'EXPERIMENTAL' features, Use Hard Links and Use Optimized Account Backup Tool? Would it be safer to leave these disabled if we're concerned about taxing our system, or could these really help?

    7) Is there a default time that backups run? I didn't see anything regarding time. Just wanted to make sure they're running in the middle of the night if possible.

    Thanks! Any other tips/tricks I should watch for would be greatly appreciated!!
     
  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
    Hello,

    If you do not select the remote FTP option, then the backups will save to the partition or folder on the local machine. There's no way in cPanel to access the directory, but you can restore the backups from that directory in WHM > Backup area.

    This will not save 3 different backups. It would save a daily backup each time it runs and a weekly backup once a week.

    Incremental backups will only back up changed files, so if files don't frequently change, this would be less taxing to the system. Databases would still be backed up using that option provided you have selected to back up databases.

    Compressing backups will take longer as they have to be compressed during the process. It also will take more system resources. It would take less space, though.

    Yes, the entire MySQL directory contains /var/cpanel/mysql/mysql database, which has root and the other users in it. If you don't select to back up the entire directory, that specific database isn't going to be backed up. It's the most important database on the system.

    It would be safer to leave them disabled. They are experimental because there was not sufficient quality assurance testing for bugs associated with them.

    On my system, the cpbackup cron is set for 1:00am server time. If you enable backups, simply check /var/spool/cron/root for when the cron is going to run:

    Code:
    grep cpbackup /var/spool/cron/root
    Thanks!
     
  3. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Great, thanks for the quick & thorough reply! Just a couple follow-up questions:

    I believe we have a way to access root files using Parallels Power Panel. So if we downloaded individual backup files periodically as an 'archive', if we needed to recover at some point would we just need to overwrite the current backup files, or can you restore from an off-site file? Want to make sure saving archives won't be problematic.

    OK, this is a bit confusing but I think I follow. So even though I don't select 'Daily Backups', they would still occur (just not store?!?) When would the weekly backups occur and would they just be identical to one of the daily backups? If there is documentation better outlining how exactly the day/week/month options actually work, that might be helpful.

    --------

    Thanks again! I think we may try incremental backups with both the Account and Full database backups. Just trying to think of the best intervals and storage to be safe (including the possibility of occasionally downloading backups) without over-taxing our system.
     
  4. 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
    You cannot restore from an off-site file. You'd have to place them back onto the machine for them to be able to be restored.

    Actually, if you aren't going to select Daily, then this wouldn't be quite the case. Looking over the Configure Backup area, if you select weekly and select multiple days, the backup will not run on multiple days. It will run once a week and check the other days if the backup ran. If the backup timestamp is less than a week, backups will not run again. They will only run once a week. If you select to retain weekly and monthly under that option, you'll get a monthly archive and a weekly archive. We overwrite the prior backup each time we run a new one.

    I would suggest selecting daily and only selecting 3 days a week. If you do that, you'll have backups run those 3 days and get a daily, weekly and monthly backup (if you choose to retain the monthly one). The daily backup will not be every day, since you are only selecting to run it on set days of the week. Since again we overwrite the data each time we do run the backups if the time of the folder stamp is older than the increment, you'll end up with 1 daily backup on the days it runs (overwriting the prior daily), a weekly backup if it has been a week since the last backup for the weekly folder, and a monthly backup if it has been a month since the last backup for the monthly folder.

    If you are going to copy the backups off the server periodically, you likely won't need to have a monthly backup retained anyway.
     
  5. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Perfect, thank you! This is very helpful. But I'm sorry, I just saw a couple last items that I don't fully understand. This should be it, and will hopefully help others in our situation.

    8) Don't really understand the 'Use local DNS zone files rather than retrieving the latest zone updates from the cluster' option. Could you offer a little more insight here?? Is it referring to local DNS settings we make in cPanel vs. somewhere else? We don't make changes to DNS setting very often, usually just once and leave it.

    9) Backup Access Logs & Bandwidth Data option. Could these be large, time-consuming backups? Or are they fine to grab. Not sure how/why we would generally need them in most instances, but would backup if not a huge hit.
     
  6. 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
    If you are using DNS clustering, then this option applies. It means you'd grab the local DNS files if you enable it rather than retrieving the latest zone files from the cluster. If the server is not clustered to another DNS only machine, then you definitely should enable this option.

    These could be large and aren't typically a necessity if lost. You'd only lose the bandwidth and access logs data for stats. I would suggest not backing these up if you want to reduce the space of the backups and improve performance for backups.
     
  7. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    OK, we made our first backup based upon the settings recommended here! We only selected a couple accounts to be backed up for this initial testing.

    I guess (not sure why) I didn't expect an exact clone of every file, directory, and file structure to be copied to our backup directory. So there's no reasonably easy way at this point to download copies of these backups for safe keeping locally.

    A) I would have to enable backup compression to get a collected file I could download, correct? If so, would it just be everything in the entire account directory as I'm looking at now (including directories like cron, dnszones, logs, meta, etc. as well as the homedir)?

    B) With compression, would each account be a separate compressed file, or would they be all-in-one? What about the more global VPS items (i.e., dirs, files)?

    C) Does Incremental Backups work with the Compress Backups function?

    D) Is there a relatively easy way to check logs on this first backup to see how long it took, space it's all taking up, and/or resources used? We want to get a good handle on how we should set it up before we enable all 30+ accounts to be backed up.

    Thanks again for all the great help here!
     
  8. 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
    Yes, you'd have to enable backup compression to get a collected file to download. Alternatively, you could script having the contents periodically compressed and ftped and then cron the script. The backup would be everything in the user's home directory and their settings. A complete archive the same as if you created a backup of that one user's account.

    Each account will be one compressed file. The global items would be separately compressed.

    No, it does not. This is indicated in the interface:

    There are logs at /usr/local/cpanel/logs/cpbackup location, but those logs do not indicate the space and/or resources. You can see how long it did take there, though.

    Of note, you can easily see the space used by running "du -sh /backup" or checking the space on whatever folder it is occupying.

    You can see the resources used by running "sar" and checking the times it ran to see how the system handled the CPU during the backup.
     
  9. jethrodesign

    jethrodesign Active Member

    Joined:
    Feb 17, 2012
    Messages:
    41
    Likes Received:
    1
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    OK, I changed my settings to do compressed backups. Otherwise, the backups would have max'd out my disk inodes, and the entire VPS would have came to a halt pretty much! Glad I just happened to look into that before running the full backup on all accounts (YIKES!!!). STRONG warning to others doing uncompressed backups - make sure you have enough available disk inodes, not just disk space available to more than double! We were only using 1/3 the total space, but over 2/3 the total available disk inodes.

    So I did a test backup with just 2 accounts, one being our largest (1GB). I checked the logs as mentioned, and the entire process took about 15 minutes. I've enabled another 10+ accounts for tonight to see how that goes up.

    But I did notice a lot of lines that said: "Waiting for load to go down to continue"

    - Is that fairly standard, or were we already totally maxing out our poor server?

    I'll see if I can check the overall resources with the command mentioned.

    Thanks again!
     
  10. 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
    You could check the extracpus option in /var/cpanel/cpanel.config file:

    Code:
    root@host [~]# grep cpu /var/cpanel/cpanel.config
    extracpus=0
    The default is 0, which means if the load goes over 1, then you'll receive load warnings during the backup. Increase it from 2 to 5 depending on how much RAM and CPUs you have to handle higher loads on the VPS. After changing the setting, run the following command:

    Code:
    /usr/local/cpanel/whostmgr/bin/whostmgr2 --updatetweaksettings
    Please note this setting corresponds to the one in WHM > Tweak Settings > Extra CPUs for server load option. You could also change it there instead and save the setting change.

    Thanks!
     
Loading...

Share This Page