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 not working

Discussion in 'General Discussion' started by The MAzTER, Feb 7, 2005.

  1. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    When i add a cronjob though cpanel, it doenst work

    the following mail do i get:

    Shell access is not enabled on your account!
    If you need shell access please contact support

    cron:
    * /5 * * * * php -f /home/<user>/public_html/cronjob.php
     
  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
    Odd. Do you have an /etc/cron.deny or /etc/cron.allow file?
     
  3. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    yep

    and in allow: all

    and deny is empty
     
  4. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Hmm. I'd rename or delete both files and restart the crond daemon and try again.
     
  5. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    delete /etc/cron.deny and /etc/cron.allow?
     
  6. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Yup. You could just rename them out of the way if you prefer, then restart crond.
     
  7. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    Ok:
    - i looked wrong, there are only fcron.allow and .deny files
    - i moved those 2 files restarted and noticed i didnt get mail at all, but the script wont work either since the first line in the script mails me that it works (php -f /home/<user>/public_html/cronjob.php works fine)
    - moved the 2 files back and no email at all as well now
    - fcrontab -u <user> -l still shows the cron
    - all logs in /var/log/cron are empty!
     
  8. Marty

    Marty Well-Known Member

    Joined:
    Oct 10, 2001
    Messages:
    630
    Likes Received:
    1
    Trophy Points:
    18
    From cron, you might want to use the full path to php, rather than just php, like this:

    * /5 * * * * /usr/bin/php -f /home/<user>/public_html/cronjob.php

    Not sure if that will solve the issue, but it is a thought.
     
  9. The MAzTER

    The MAzTER Well-Known Member

    Joined:
    Jul 3, 2003
    Messages:
    106
    Likes Received:
    0
    Trophy Points:
    16
    already tried that, doesnt help either
     
Loading...

Share This Page