Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default Force cpbackup, regardless of server load

    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. #2
    cPanel Development cpanelkenneth's Avatar
    Join Date
    Apr 2006
    Posts
    3,788
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by verdon View Post
    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
    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. #3
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Thanks very much for the advice... I'll wait til late tonight and give it a shot.

  4. #4
    Member LiNUxG0d's Avatar
    Join Date
    Jun 2003
    Location
    Gatineau, Quebec, Canada
    Posts
    206

    Default

    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.
    http://www.okteck.com/
    The best web hosting, reseller hosting and dedicated server packages!

  5. #5
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Hi neighbour.. I appreciate the tips.

    Quote Originally Posted by LiNUxG0d View Post
    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.
    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

    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.
    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. #6
    Member LiNUxG0d's Avatar
    Join Date
    Jun 2003
    Location
    Gatineau, Quebec, Canada
    Posts
    206

    Default

    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,
    http://www.okteck.com/
    The best web hosting, reseller hosting and dedicated server packages!

  7. #7
    Member verdon's Avatar
    Join Date
    Nov 2003
    Location
    Northern Ontario, Canada
    Posts
    792

    Default

    Quote Originally Posted by LiNUxG0d View Post
    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,
    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

Similar Threads & Tags
Similar threads

  1. Cpbackup --force
    By fazaha in forum Data Protection
    Replies: 8
    Last Post: 03-17-2010, 08:31 AM
  2. Cpbackup --force
    By fazaha in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 03-16-2010, 05:40 AM
  3. Make cpbackup ignore server load
    By iUnknown in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-14-2008, 08:32 AM
  4. cpbackup gzip always causing high server load
    By hbhb in forum cPanel and WHM Discussions
    Replies: 4
    Last Post: 05-14-2008, 04:45 AM
  5. /scripts/cpbackup --force
    By benfish in forum cPanel and WHM Discussions
    Replies: 3
    Last Post: 11-17-2007, 07:29 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube