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!

HELP -- I just deleted my crontab file.

Discussion in 'General Discussion' started by jlimited, Apr 15, 2005.

  1. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Hello,

    I wanted to edit at my crontab file as root and I fat fingered the following command:

    "crontab -r" when I wanted to type "crontab -e".

    When I googled my problem I found that I should not have used crontab -e, but I should have edited crontab.txt and then "crontab crontab.txt"

    What can I do?

    Thanks
    Jlimited
     
  2. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    22
    Trophy Points:
    463
    Location:
    Go on, have a guess
    Wherever you found that advice, it was wrong. You should only use crontab -e to edit your crontabs (or you can use te cPanel interface for end-user crontabs).

    You don't say which crontab you have deleted, but if it is the root crontab, you can recreate it using:

    crontab -e

    Then in the edit add the following:

    Code:
    */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    23 23 * * * /scripts/upcp
    0 1 * * * /scripts/cpbackup
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
    Which should put you back with the default crontab entries for cPanel on a Linux server.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Thanks...Yes it was my root crontab.

    Jlimited
     
  4. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Where does the rotate log script get used?

    Thanks
    Jlimited
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    22
    Trophy Points:
    463
    Location:
    Go on, have a guess
    If you mean for the server logs, then that's in /etc/cron.daily/logrotate
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    Thanks again for all the help.
     
  7. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    156
    root crontab file

    Hey,

    I noticed that my remote ftp backup did not work tonight. Is there a special place where the root crontab file should be. Currently it is in /var/spool/cron and is named "root"

    Thanks
    Jlimited
     
  8. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,460
    Likes Received:
    22
    Trophy Points:
    463
    Location:
    Go on, have a guess
    The root crontab is indeed in /var/spool/cron/root, but you should never edit that file directly as explained above.
     
    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