Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Crontab empty after update

Discussion in 'General Discussion' started by Olof, Aug 2, 2016.

Tags:
  1. Olof

    Olof Member

    Joined:
    Jan 18, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    stockholm, sweden
    cPanel Access Level:
    Root Administrator
    Recently updated to WHM 56.0 (build 29) and my root crontab is now empty.

    1, Is there more than one crontab?
    2, How do I get it back? (I do not update WHM/Cpanel).

    cat /etc/crontab gives the following:

    SHELL=/bin/bash

    PATH=/sbin:/bin:/usr/sbin:/usr/bin

    HOME=/


    # For details see man 4 crontabs


    # Example of job definition:

    # .---------------- minute (0 - 59)

    # | .------------- hour (0 - 23)

    # | | .---------- day of month (1 - 31)

    # | | | .------- month (1 - 12) OR jan,feb,mar,apr ...

    # | | | | .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat

    # | | | | |

    # * * * * * user-name command to be executed
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    The root crontab is stored at:

    Code:
    /var/spool/cron/root
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Olof

    Olof Member

    Joined:
    Jan 18, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    stockholm, sweden
    cPanel Access Level:
    Root Administrator
    Thanks!

    But that one is completely empty (just one newline).

    WHM runs several cron jobs, are those also gone now?
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    You can use the "crontab -e" command to add the entries back into the root crontab. Here are the default entries:

    Code:
    0 6 * * * /usr/local/cpanel/scripts/exim_tidydb > /dev/null 2>&1
    30 5 * * * /usr/local/cpanel/scripts/optimize_eximstats > /dev/null 2>&1
    30 23 * * * /usr/local/cpanel/scripts/upcp --cron
    0 1 * * * /usr/local/cpanel/scripts/cpbackup
    0 2 * * * /usr/local/cpanel/bin/backup
    35 * * * * /usr/bin/test -x /usr/local/cpanel/bin/tail-check && /usr/local/cpanel/bin/tail-check
    45 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_mailman_cache && /usr/local/cpanel/scripts/update_mailman_cache
    30 */4 * * * /usr/bin/test -x /usr/local/cpanel/scripts/update_db_cache && /usr/local/cpanel/scripts/update_db_cache
    30 */2 * * * /usr/local/cpanel/bin/mysqluserstore >/dev/null 2>&1
    15 */2 * * * /usr/local/cpanel/bin/dbindex >/dev/null 2>&1
    15 */6 * * * /usr/local/cpanel/scripts/autorepair recoverymgmt >/dev/null 2>&1
    */5 * * * * /usr/local/cpanel/scripts/dcpumon-wrapper >/dev/null 2>&1
    20 2 * * * /usr/local/cpanel/whostmgr/docroot/cgi/cpaddons_report.pl --notify
    13,28,43,58 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. Olof

    Olof Member

    Joined:
    Jan 18, 2016
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    stockholm, sweden
    cPanel Access Level:
    Root Administrator
    Thanks!

    It would be nice if it warned me, when deleting all cron jobs after updating...
     
  6. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I've not seen any additional reports of the cPanel update process erasing the root crontab. Feel free to open a support ticket using the link in my signature so we can take a closer look and see if we can determine how it was erased. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. Daniel Gheorghe

    Daniel Gheorghe Registered

    Joined:
    Jan 19, 2016
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Targoviste
    cPanel Access Level:
    Root Administrator
    Hi guys,

    I've had the same issue - root crontab was empty after suddenly...
    Maybe you can investigate things further ?

    Thanks for putting the default crontab here... I just pasted it back in for now.

    Thanks,
     
  8. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Feel free to open a support ticket using the link in my signature so we can take a closer look. You can post the ticket number here so we can update this thread with the outcome.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. loudcanvas

    loudcanvas Registered

    Joined:
    Nov 5, 2017
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Somersworth NH
    cPanel Access Level:
    Root Administrator
    Same issue. All of a sudden I noticed my daily backups stopped running back around Jan 11 (this could have been SUPER bad news if a site had an issue). I checked cron and low-and-behold: ALL lines missing for some reason.

    I just pasted all the correct entries back (thank you for posting them). But I am VERY concerned this is a bandaid solution. What caused them to go missing in the first place?? We never login to this box as root EVER -- so there is no chance it was human error.
     
  10. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    45,442
    Likes Received:
    1,961
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @loudcanvas,

    Feel free to open a support ticket using the link in my signature if you'd like us to take a closer look to see what might have happened on your system.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice