Results 1 to 5 of 5
  1. #1

    Cron Job Deleted is Their a Log?


    We are running cpanel on one of our servers. Several cron jobs were deleted from the cron panel of one acct. I have no idea of the paths to re-enter these jobs. Is their a log file on the server that will show cron job history from previous runs so I can recover the proper paths? Any help is appreciated. Thanks!

  2. #2
    Join Date
    Oct 2004
    Kerala, India
    See the file /var/log/cron. You can use the following command to see what all cron jobs have run in past for a particular user.

    grep username /var/log/cron
    David |
    Affordable Server Management Solutions sales AT cliffsupport DOT com
    CliffWebManager | Access WHM from iPhone and Android

  3. #3
    Join Date
    May 2009
    The cron path of the account will be:

    "/var/spool/cron/user_name" ; say if your account user was 'xyz, his cronjobs will be in the file "/var/spool/cron/xyz".

    But its not necessary to add new crons this way, we have another simple option:

    Use the "-u" switch along with crontab:

    crontab -e -u xyz ; will open the file to enter cron jobs for the user "xyz".

    To list this account's cronjobs, run the below command:

    crontab -l -u xyz.

    I hope that helps.

  4. #4
    Thanks, the problem is the cron jobs were accidentally deleted from this users acct. They wiped out or overrode their jobs. Does an individual account store these within a backup someplace? Then I could simply copy them back over? If they are stored in a backup, where would they be located?


  5. #5
    Join Date
    May 2009
    Yes, if you have a previous backup then that will contain the users cron job too.

    Use 'tar -tf account.tar.gz' command to list the contents of the backup without extracting it.

    If it is a gzip file, then use 'tar -tzf account.tar.gz' instead.

    It should have a folder called "cron".

    Extract the archive and then copy the cron to /var/spool/cron/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts