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.

cron jobs not running

Discussion in 'General Discussion' started by Arhineus, Dec 30, 2007.

  1. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    I'm not sure what has happened, but it seams like our cron jobs have suddenly stopped working. I have restarted the service, but that doesn't seam to correct the issue.

    My /etc/crontab file consists of the following.

    Code:
    SHELL=/bin/bash
    PATH=/sbin:/bin:/usr/sbin:/usr/bin
    MAILTO=root
    HOME=/
    
    # run-parts
    01 * * * * root run-parts /etc/cron.hourly
    02 4 * * * root run-parts /etc/cron.daily
    22 4 * * 0 root run-parts /etc/cron.weekly
    42 4 1 * * root run-parts /etc/cron.monthly
    
    But the jobs themselves don't seam to be running.
     
  2. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    The user crons are located at /var/spool/cron. Have you checked the files there?
     
  3. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    The contents of the user crons seam to be correct. An example would be:

    Code:
    MAILTO="USER"
    10 4 * * * php -q -f /home/USER/public_html/tools/updtransfers.php /home/USER/public_html >/dev/null 2>&1
    10 5 * * * php -q -f /home/USER/public_html/tools/updateexp.php /home/USER/public_html >/dev/null 2>&1
    10 5 * * * php -q -f /home/USER/public_html/tools/invoice_cron.php /home/USER/public_html >/dev/null 2>&1
    
    or

    Code:
    */5 * * * * /usr/local/bin/php -c /home/USER/php.ini /home/USER/public_html/poller.php > /dev/null 2>&1
    
    None of these are being run as they are supposed to be.
     
  4. WebScHoLaR

    WebScHoLaR Well-Known Member

    Joined:
    Dec 14, 2005
    Messages:
    511
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Planet Earth
    Have you checked /var/log/cron that what it reports regarding the user crons? Also try executing the same command mentioned in cron from command line to see if there is any error?
     
  5. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    I have checked the log, and I don't see any errors anywhere. When running the command manually they are running properly.
     
  6. claudio

    claudio Well-Known Member

    Joined:
    Jul 31, 2004
    Messages:
    201
    Likes Received:
    0
    Trophy Points:
    16
    you need to check in /etc/cron.d/ if your cron files are chmod as 644 otherwise the will not run even in 777 or 755

    regards

    Claudio
     
  7. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    So the entire contents of /etc/cron.d needs to me CMOD to 644? Mine obviously is not.

    Code:
    [root@webhost69 cron.d]# ls -all
    total 60
    drwxr-xr-x   2 root root  4096 Dec 17 03:07 .
    drwx--x--x  94 root root 12288 Jan  3 09:28 ..
    -rw-r--r--   1 root root    61 Jun 22  2007 csf_update
    -rw-r--r--   1 root root    81 Apr 11  2007 lsm
    -rw-r--r--   1 root root    79 Jun 22  2007 prm
    -rw-------   1 root root   366 Feb 23  2007 sa-update
    -rw-r--r--   1 root root    82 Jun 22  2007 spri
    -rw-r--r--   1 root root   188 Nov 16 23:14 sysstat
    [root@webhost69 cron.d]#
     
  8. Arhineus

    Arhineus Well-Known Member

    Joined:
    Nov 1, 2005
    Messages:
    58
    Likes Received:
    0
    Trophy Points:
    6
    I've taken a further look into this.

    The cron jobs are being called, however when run automatically they aren't doing anything. I've watched the /var/log/cron log as the jobs are being called, and when the log has an entry for each, I check to see if it worked properly, but it doesn't....??? When run manually, they work perfectly.
     
  9. shacker23

    shacker23 Well-Known Member

    Joined:
    Feb 20, 2005
    Messages:
    263
    Likes Received:
    1
    Trophy Points:
    16
    After upgrading from RH9 to CentOS 4.x, my user crontabs are not running. It looks like files in /var/spool/cron have a variety of different permissions. Can someone tell me what perms those files *should* have?

    Thanks.
     
Loading...

Share This Page