+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
Like Tree5Likes

Thread: Cron job not working!! help!!!

  1. #1
    waldopulanco29 is offline x10Hosting Member waldopulanco29 is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    14

    Cron job not working!! help!!!

    hello!! i have a problem with cron job. it doesn't work with me, my server is chopin.x10hosting.com
    and here is my command
    * * * * * php -q /home/username/etc/cron.php

    it will execute every minutes.
    but it will not execute.
    and i have no email receive about cronjob is run!!

    i hope it will fix as soon as posible.
    my server is chopin.x10hosting.com

    thanks in advance!!

  2. #2
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Cron job not working!! help!!!

    As per the ToS, running a cron job every minute will get you suspended. You can run no more than one cron job every 5 minutes. You could fill out the minute field yourself (*/5), but a better choice for novices is to use cPanel's cron wizard.

    "-q" isn't a valid command line option to PHP.

    Give the full path to the PHP binary. Either "/usr/bin/php" or "/usr/local/bin/php" should work.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

  3. #3
    waldopulanco29 is offline x10Hosting Member waldopulanco29 is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    14

    Re: Cron job not working!! help!!!

    sir which is the correct comand?
    */5 * * * * /usr/bin/php -q /home/username/etc/cron.php

    or without -q?

    */5 * * * * /usr/bin/php /home/username/etc/cron.php

    please give me some some sample!!

    thanks in advance!

  4. #4
    waldopulanco29 is offline x10Hosting Member waldopulanco29 is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    14

    Re: Cron job not working!! help!!!

    i try the following command but it won't work

    php -q /home/username/etc/cron.php

    php-cron /home/username/etc/cron.php

    php-cron -q /home/username/etc/cron.php

    /usr/local/bin/php -q /home/username/etc/cron.php

    /usr/bin/php -q /home/username/etc/cron.php
    Last edited by waldopulanco29; 05-29-2010 at 03:29 AM.

  5. #5
    slacker_'s Avatar
    slacker_ is offline x10Hosting Member slacker_ is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    16

    Re: Cron job not working!! help!!!

    try

    /usr/bin/php -f /home/waldopulanco29/path/to/your/cron.php

  6. #6
    waldopulanco29 is offline x10Hosting Member waldopulanco29 is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    14

    Re: Cron job not working!! help!!!

    Quote Originally Posted by slacker_ View Post
    try

    /usr/bin/php -f /home/waldopulanco29/path/to/your/cron.php
    sir it also dont work. any idea sir?

  7. #7
    slacker_'s Avatar
    slacker_ is offline x10Hosting Member slacker_ is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    16

    Re: Cron job not working!! help!!!

    go to your cpanel, look at Stats -> Home Directory,
    where you can see your username

    scroll down to Advanced -> click on Cron jobs

    under "add new cron job" click on "minute" -> every five minutes (*/5)

    Command:
    /usr/bin/php -f /home/your_username/www/cron.php >/dev/null 2>&1

    which should work fine.

    you can do a test write every 5 minutes, for example

    cron.php:
    PHP Code:
    <?php
    $content 
    ".";

    $f fopen ("/home/your_username/www/scores.txt""a+");
    fwrite($f,$content,strlen($content));
    fclose($f); 

    ?>
    (remember to create cron.php in your document root)

    open "scores.txt" in your browser to see if it works,
    there should be an dot added every five minutes..
    Last edited by slacker_; 05-29-2010 at 09:24 AM.
    neilmegahey36 and felixhaus92 like this.

  8. #8
    waldopulanco29 is offline x10Hosting Member waldopulanco29 is an unknown quantity at this point
    Join Date
    May 2010
    Posts
    14

    Re: Cron job not working!! help!!!

    thank you so much sir now is working!!
    please close this thread!!

    best regards
    waldo!!

  9. #9
    imaks07 is offline x10Hosting Member imaks07 is an unknown quantity at this point
    Join Date
    Dec 2009
    Posts
    3

    Re: Cron job not working!! help!!!

    Many Thanks worked for me as well.

  10. #10
    misson is offline x10 Spammer misson is a jewel in the rough
    Join Date
    Mar 2008
    Location
    Libertatia
    Posts
    2,506

    Re: Cron job not working!! help!!!

    Don't revive dead threads. Don't pollute threads with contentless posts. If you wish to thank someone in these forums, use the "Like" link, or give them reputation.
    vv.bbcc19 and neilmegahey36 like this.
    Be sure to read all pages linked in this post; they have further information that should prove useful. When asking for help, make sure you follow Eric Raymond's and Jon Skeet's guidelines for prompt, accurate responses. Please answer any questions I ask; they're not rhetorical (probably). Any posted code is intended as illustrative example, rather than a solution to your problem to be copied without alteration. Study it to learn how to write your own solution.
    Misson, not Mission.

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. cron job is not working
    By bonsaing in forum Free Hosting
    Replies: 1
    Last Post: 04-13-2010, 01:56 AM
  2. cron job is not working
    By charitymadurai in forum Free Hosting
    Replies: 0
    Last Post: 07-07-2009, 11:27 AM
  3. Cron working now...
    By woodyl in forum Free Hosting
    Replies: 2
    Last Post: 04-25-2009, 07:02 AM
  4. Cron Not Working
    By BlackIrish in forum Free Hosting
    Replies: 15
    Last Post: 10-11-2007, 02:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers