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.

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:
    6
    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,475
    Likes Received:
    20
    Trophy Points:
    38
    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.
     
  3. jlimited

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    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:
    6
    Where does the rotate log script get used?

    Thanks
    Jlimited
     
  5. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    If you mean for the server logs, then that's in /etc/cron.daily/logrotate
     
  6. jlimited

    jlimited Well-Known Member

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

    jlimited Well-Known Member

    Joined:
    Jun 4, 2004
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    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,475
    Likes Received:
    20
    Trophy Points:
    38
    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.
     
Loading...

Share This Page