Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2007
    Posts
    79

    Help: Cronjob not working?

    I currently have this cronjob setup:

    */2 * * * * /usr/bin/php /home/admin/domains/vilegaming.com/public_html/test.php
    ..but it doesn't seem to execute the script? I'm on a VPS running DirectAdmin.

  2. #2
    Join Date
    Apr 2002
    Location
    Auckland - New Zealand
    Posts
    1,575
    Is the test.php chmod 755 or 750?

    Alternatively, use /usr/bin/php -q /home/admin/domains/vilegaming.com/public_html/test.php

  3. #3
    Join Date
    Jul 2009
    Posts
    178
    /usr/local/bin/php /home/admin/domains/vilegaming.com/public_html/test.php


    This should work.

  4. #4
    Join Date
    Mar 2009
    Location
    Gods Own Country
    Posts
    681
    ..but it doesn't seem to execute the script?
    In which location do you have php exactly? Try running the command..
    Code:
    whereis php
    and ensure that crond is running.
    Fabin Mundattil @ Xieles Support
    High Quality Server Management | support @ xieles.com
    https://xieles.com

  5. #5
    Join Date
    Apr 2005
    Location
    Cochin
    Posts
    2,452
    can u execute the cron in the commandline ?

    Also tail the cron log to confirm that it is not actually running

  6. #6
    Join Date
    Sep 2007
    Posts
    369

    *

    Quote Originally Posted by krissauquillo View Post
    I currently have this cronjob setup:



    ..but it doesn't seem to execute the script? I'm on a VPS running DirectAdmin.
    First run your script manuallly

    php /home/admin/domains/vilegaming.com/public_html/test.php

    Also check php path.

    Another alternative to check

    wget -q -O /dev/null http://vilegaming.com/test.php > /dev/null

    Also check cron log.

    #tail -f /var/log/cron
    Thanks,
    Noman
    noman@linuxonsupport.com
    O Canada, we stand on guard for thee

  7. #7
    Join Date
    Jan 2007
    Posts
    79
    Quote Originally Posted by StevenG View Post
    Is the test.php chmod 755 or 750?

    Alternatively, use /usr/bin/php -q /home/admin/domains/vilegaming.com/public_html/test.php
    Tried both, none worked.

    Quote Originally Posted by eth10 View Post
    /usr/local/bin/php /home/admin/domains/vilegaming.com/public_html/test.php

    This should work.
    Yea, that is the correct path (the "/local/").

    Quote Originally Posted by fabin View Post
    In which location do you have php exactly? Try running the command..
    Code:
    whereis php
    and ensure that crond is running.
    Did so and it was in "/usr/local/bin/php". I tried that with the other posters' recommandations and still nothing works.

    Quote Originally Posted by nomankhn View Post
    First run your script manuallly

    php /home/admin/domains/vilegaming.com/public_html/test.php

    Also check php path.
    I tried this, with SSH access..
    Code:
    Last login: Mon Aug 24 03:39:05 from cpe-98-155-40-235.san.res.rr.com
    [root@server ~]# php /home/admin/domains/vilegaming.com/public_html/test.php
    
    Warning: require(system/database.mysql.php): failed to open stream: No such file or directory in /home/admin/domains/vilegaming.com/public_html/system/common.php on line 22
    
    Fatal error: require(): Failed opening required 'system/database.mysql.php' (include_path='.:/usr/local/lib/php') in /home/admin/domains/vilegaming.com/public_html/system/common.php on line 22
    Quote Originally Posted by nomankhn View Post
    Another alternative to check

    wget -q -O /dev/null http://vilegaming.com/test.php > /dev/null

    Also check cron log.

    #tail -f /var/log/cron
    Doesn't work either (the "wget" command).

    Here is what my command looks like in DirectAdmin's interface:
    http://i30.tinypic.com/2ep2d52.png

  8. #8
    Join Date
    Jan 2007
    Posts
    79
    Er, wait..
    Code:
    wget -q -O /dev/null http://vilegaming.com/test.php > /dev/null
    ..it just started working now about 10 minutes after altering/saving that command.

    I'm just curious.. what does the "-O" and the "> /dev/null" do? I know the "-q" tells it to run in quiet mode.

    Thanks, nomankhn!

  9. #9
    Join Date
    Jan 2007
    Posts
    79
    I realized that the "> /dev/null" isn't needed for the cron to work, by taking it out.

  10. #10
    Join Date
    Sep 2007
    Posts
    369

    *

    Quote Originally Posted by krissauquillo View Post
    Er, wait..
    Code:
    wget -q -O /dev/null http://vilegaming.com/test.php > /dev/null
    ..it just started working now about 10 minutes after altering/saving that command.

    I'm just curious.. what does the "-O" and the "> /dev/null" do? I know the "-q" tells it to run in quiet mode.

    Thanks, nomankhn!

    Welcome.

    where -O

    --output-document=file

    i dont have detail about your script, if its not require you may ignore it.
    Thanks,
    Noman
    noman@linuxonsupport.com
    O Canada, we stand on guard for thee

Similar Threads

  1. how to do this with a cronjob?
    By HD Fanatic in forum Hosting Security and Technology
    Replies: 8
    Last Post: 07-15-2007, 11:08 PM
  2. SSH Cronjob
    By priceww in forum Hosting Security and Technology
    Replies: 8
    Last Post: 03-02-2007, 12:00 AM
  3. Help With Cronjob!
    By sikkhost in forum Hosting Security and Technology
    Replies: 2
    Last Post: 09-15-2004, 09:36 AM
  4. Need CronJob help!!
    By WP1 in forum Web Hosting
    Replies: 0
    Last Post: 03-06-2003, 04:48 PM
  5. Cronjob! help me...
    By FrzzMan in forum Web Hosting
    Replies: 4
    Last Post: 03-05-2003, 11:57 AM

Posting Permissions

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