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.

Make cpbackup ignore server load

Discussion in 'Data Protection' started by iUnknown, Jul 11, 2008.

  1. iUnknown

    iUnknown Member

    Joined:
    Jul 11, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    My server load on my server is very high, but my server is not slow, my memory usage is fine, my CPUs are handling everything fine so it's not really a problem... except I've got a lot of "sleeping processes" which seem to increase the server load but not affect the server really.

    My problem is, cpbackup refuses to run when it decides the server load is too high. So, is there a way to make it run no matter what the server load is? Because I do want backups to run again...

    The server load never goes down because these things are always running, so running it at early hours of the morning doesn't make a difference.

    Any ideas or solutions would be appreciated. Thanks.
     
  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
    Edit /scripts/cpbackup to change the following lines:

    Code:
    sub cpusystem {
        if ( my $cpupid = fork() ) {
            local $SIG{'TERM'} = $SIG{__DIE__} = sub {
                if ( $$ == $original_child_pid ) {
                    unlink '/var/cpanel/backuprunning';
                }
                if ($cpupid) {
                    kill( 8, $cpupid );
                    sleep(2);
                    kill( 9, $cpupid );
                }
                exit(1);
            };
            waitpid( $cpupid, 0 );
        }
        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(@_);
            #}
    
    That will force the backup to run w/o the benefit of load monitoring.
     
  3. iUnknown

    iUnknown Member

    Joined:
    Jul 11, 2008
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    Thanks very much. So far it's working perfectly.

    Thanks again.
     
Loading...

Share This Page