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.

2 backup crons - necessary?

Discussion in 'Data Protection' started by sahostking, Nov 15, 2013.

  1. sahostking

    sahostking Well-Known Member

    Joined:
    May 15, 2012
    Messages:
    300
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Cape Town, South Africa
    cPanel Access Level:
    Root Administrator
    Hi guys,

    Been reviewing our servers today and 2 of them seem to have the following crons:

    0 2 * * * /usr/local/cpanel/bin/backup

    and

    0 1 * * * /usr/local/cpanel/scripts/cpbackup


    Is this a duplication?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,807
    Likes Received:
    667
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    The "/usr/local/cpanel/bin/backup" script is for the new backup system and the "/usr/local/cpanel/scripts/cpbackup" script is for the legacy backup system. You are welcome to delete the legacy backup script cron job if you do not use legacy backups. Note that both existing backup scripts running on a cron job will not cause additional load. The backup scripts only generate actual backup archives when backups are enabled.

    Thank you.
     
  3. XenomediaBV

    XenomediaBV Well-Known Member

    Joined:
    Sep 3, 2009
    Messages:
    60
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    The Netherlands
    cPanel Access Level:
    Root Administrator
    @cPanelMichael. Actually not entirely true. Due to the crontab legacy entry there is actually a pid stored in "/var/cpanel/backuprunning". The legacy backup script will finish quick because legacy is disabled. But in some cases the pid entry in "/var/cpanel/backuprunning" is not cleaned up properly (it happened on one of our machines).

    This gives the error message:
    Code:
    "warn [backup] The other backup type is running as evidenced by the existence of:  /var/cpanel/backuprunning"
    By default the crontab generated by cPanel contains:
    Code:
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    0 2 * * * /usr/local/cpanel/bin/backup
    As you can see the legacy backup is attempted first. Therefore, the above failure will block the new backup entirely because the new version checks if the old version might be running through "/var/cpanel/backuprunning".

    So if legacy backup is not used it is even better to remove the cron entry for legacy period. To do it entirely right set the new backup script to start at the same time the legacy did in case there is limited time for a nightly run.

    Code:
    0 1 * * * /usr/local/cpanel/bin/backup
    After fixing this the new backup script is running properly again.
     
Loading...

Share This Page