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.

Force cpbackup, regardless of server load

Discussion in 'Data Protection' started by verdon, Apr 2, 2008.

  1. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Hi,

    I've been having server and load troubles slowly increasing for a few weeks and am preparing to move to another server. I believe my 6 year old server is just getting tired, but that's another story.

    One problem I am having is that I haven't had a successful backup in about a week now. Pretty much all I am getting is 'Waiting for load to go down...' My load is avg is about 2-4 all the time and spiking to 5 minute avg's of 5-10 seven or eight times a day.

    Is there someway I can get cpbackup to run regardless of load avg? I know I can run /scripts/cpbackup --force & but that still respects load. I've looked through the script and wonder if I should just change..

    POSIX::nice(19);

    .. but I'm unsure, and unsure what would be appropriate.

    Any advice?

    Thanks,
    verdon
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    Disclaimer:

    This is not advised as it will place tremendous load upon your server

    With that said:

    1. open /scripts/cpbackup in your favorite text editor.
    2. find 'sub cpusystem' (without the quotes)
    3. Change the nested if/elsif/else block to resemble:

    Code:
        else {
            #if ( -e "$CPCONF{'root'}/bin/cpuwatch" ) {
            #   exec( "$CPCONF{'root'}/bin/cpuwatch", "$cpunum.0", @_ );
            #}
            #elsif ( -e "$CPCONF{'root'}/bin/logrunner" ) {
            #    exec( "$CPCONF{'root'}/bin/logrunner", "$cpunum.0", @_ );
            #}
            #else {
                exec(@_);
            #}
            exit 1;
        }
    
    4. Save the file and exit the editor
    5. execute /scripts/cpbackup --force


    The code changes disable the use of the process load monitors (cpuwatch and logrunner).
     
  3. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Thanks very much for the advice... I'll wait til late tonight and give it a shot.
     
  4. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hey there,

    A suggestion... make sure that your domains' catch-all accounts are ":fail:" in the /etc/valiases/domain.com because if not, chances are you have a domain that has lots of mail. Being as mail messages are small, many believe they back up really quickly, however, if there's lots of mail, physical room and blocks on the hard drive are consumed and make copies/backups VERY tedious on the CPU, and long to do. I've found most of my servers that have trouble completing backups are because of this very reason.

    I'm only bringing it up because I've done about 20 or so migrations in the last 6 months and this has been the biggest pain.

    Of course, for practicality purposes, if you have some extra space, you can switch your backups to "incremental" which will reduce the CPU power by removing the step which makes the cpbackup tar/compress the data. I like to use incremental backups because on every run, it will backup only files that have changed, and not EVERYTHING. Makes things more efficient.

    If only cPanel would allow the incremental to DELETE the old content, this backup system would be flawless. :)
     
  5. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Hi neighbour.. I appreciate the tips.

    Yes, all accounts are :fail: for catch-all. I monitor this sort of stuff regularly and only have one account on the server with more than a 10 MB of mail at any given time

    I've thought of that. I'm a little concerned in that I only have one drive, and if using incremental backups, I couldn't use my off-site copy/ftp scripts* to get a reduntant backup. I don't want all my eggs in one basket (or one drive in this case).


    * I use a script that runs every second day that ftps a copy of my cpbackup/daily folder to another server
     
  6. LiNUxG0d

    LiNUxG0d Well-Known Member

    Joined:
    Jun 25, 2003
    Messages:
    206
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Gatineau, Quebec, Canada
    Hey!

    So do I! :) You can use the Incremental backups to created the /backup/cpbackup/daily/ folder locally and create a small "rsync" script to synchronize them on an off-site location. It's pretty simple if you look at the "rsync" command. Then again, after 6 years of doing this stuff, sometimes I forget that the simplest things took me time to learn. ;)

    The beautiful part of "rsync" is that your off site backups will be quick to do since the data is very little. Rsync - when configured properly - only copies new data, and therefore, if your site is 20GB in size, and all you did was change the index.php today, well, the index.php is the only file that will be backed up by cPanel AND sent to the backup server. ;) Less I/O on the drives, less drive failure, etc.

    Lots of pros. :)

    Hope my comments can shed some light on different scenarios. We've setup some local rsync servers here with approximately 2TB and all they do all day is accept transfers from servers, to create redundant OFF-BOX backups. :)

    Warmest regards,
     
  7. verdon

    verdon Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    836
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Northern Ontario, Canada
    cPanel Access Level:
    Root Administrator
    Yes they do, thanks!

    I'll have to check with my host/DC to see if rsynch is available on the backup server. I know it wasn't when it first came online, but this may have changed. They may install it anyways.

    Thanks again,
    verdon
     
Loading...

Share This Page