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.

Deleted Root's Cron Jobs... Is There A Backup?

Discussion in 'General Discussion' started by dkz, Mar 17, 2006.

  1. dkz

    dkz Well-Known Member

    Joined:
    Sep 10, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    I was trying to add a new cron job and I typed crontab -r instead of crontab -e which deleted the cronjobs for root. Are there daily / weekly backups for cron files?

    Thanks in advance...
     
  2. dalem

    dalem Well-Known Member
    PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,577
    Likes Received:
    40
    Trophy Points:
    48
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    nope but if you run a forced cpanel upate it will add them back (other than your custom crons)
    if not here is the default



    37 1 * * * /scripts/upcp
    0 1 * * * /scripts/cpbackup
    */15 * * * * /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
    2,58 * * * * /usr/local/bandmin/bandmin
    0 0 * * * /usr/local/bandmin/ipaddrmap
    */5 * * * * /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
    0 6 * * * /scripts/exim_tidydb > /dev/null 2>&1
     
  3. dkz

    dkz Well-Known Member

    Joined:
    Sep 10, 2004
    Messages:
    100
    Likes Received:
    0
    Trophy Points:
    16
    That helps!

    Now all I have to do is remember the other ones :confused:

    Thank you.
     
  4. sparek-3

    sparek-3 Well-Known Member

    Joined:
    Aug 10, 2002
    Messages:
    1,381
    Likes Received:
    23
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    If you are using CPanel to do backups, then the cron entries should be in the backup file:

    /backup/cpbackup/daily/dirs/_var_spool_cron.tar.gz

    (Adjust variables accordingly).

    I don't know if there is a way to restore this from within the WHM, likely if there is, it would restore all of the crontabs, which you may not want to do to. To restore it from shell:

    Code:
    cd /backup/cpbackup/daily/dirs
    tar -zxf _var_spool_cron.tar.gz var/spool/cron/root
    cat var/spool/cron/root
    This will show your crontab entries for the root user that was in the backup, you will need to readd these by:

    crontab -e

    Then you may want to clear up the directories that and files that were created when you extracted the backup:

    Code:
    cd /backup/cpbackup/daily/dirs
    rm -f var/spool/cron/root
    rmdir var/spool/cron
    rmdir var/spool
    rmdir var
     
Loading...

Share This Page