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.

Script runs perfectly manually but not via cronjob

Discussion in 'General Discussion' started by t04st3d151, Jan 30, 2012.

  1. t04st3d151

    t04st3d151 Member

    Joined:
    Dec 31, 2007
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I've setup a cronjob for one of my scripts.

    If I tail the cron log file:

    Jan 30 11:53:01 vps crond[7173]: (user) CMD (/usr/bin/php -f /home/user/public_html/cron.php)
    Jan 30 11:54:01 vps crond[8043]: (root) CMD (/usr/bin/php -f /home/user/public_html/cron.php)
    Jan 30 11:54:01 vps crond[8044]: (user) CMD (/usr/bin/php -f /home/user/public_html/cron.php)

    The above shows crontab executing the command, however it doesnt actually run.

    If I manually run - /usr/bin/php -f /home/user/public_html/cron.php it picks it up and works near immediately.

    I've setup the cron under the users cpanel account as well as root to see if it was a permissions issue, but still same issue.

    Any ideas?
     
  2. storminternet

    storminternet Well-Known Member

    Joined:
    Nov 2, 2011
    Messages:
    462
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Please make sure that you have applied 755 permissions to /home/user/public_html/cron.php
    But it will be more clear after checking cron logs. Please check cron logs at /var/log/cron or if you do not have access
    to server then check it with your host.
     
Loading...

Share This Page