Closed Thread
Results 1 to 10 of 10

Thread: crontab not working

  1. #1
    orgutz is offline x10Hosting Member orgutz is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    8

    Post crontab not working

    I have recently gotten a free website, and everything is working perfectly, except the crontab jobs. I have tried different solutions found in this forum, with no success.
    In crontab jobs I have entered the comand:
    php-cron /home/orgutz/public_html/balances.php and I receive an email telling me /bin/sh: php-cron: Command not found
    I have changed to /usr/bin/php, /usr/local/bin/php, php, but sometimes I don't even get an email.
    I also included a line in the php program: #!/bin/php. Email:No such interpreter.
    The program balances.php works perfectly when launched in the browser, and was working also in another server.
    I think that the crontab is not finding the path to the php interpreter.
    The timing of the crontab is working.
    Other programs, about 25 are working smoothly, with HTML, PHP and JavaScript. Also AJAX is working.
    Also I checked the status of the server starka, and it is working, and I have Intermediate PHP level.
    I have tried all the solutions I searched in the forums, for the PHP path.
    I appreciate any help,

    Thanks,

  2. #2
    jtwhite's Avatar
    jtwhite is offline Community Advocate jtwhite is on a distinguished road
    Join Date
    May 2009
    Location
    TN, USA
    Posts
    1,381

    Re: crontab not working

    Try:

    Code:
    php /home/orgutz/public_html/balances.php
    If that doesn't work try:

    Code:
    php -q /home/orgutz/public_html/balances.php
    If I have helped you, please add to my reputation () on the bottom left corner of this post.
    jtwhite.me - Visit my site :D

  3. #3
    orgutz is offline x10Hosting Member orgutz is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    8

    Unhappy Re: crontab not working

    Thanks for your response. I have tried the two options.
    php does nothing, not even email an error message.
    php -q does the same. I think I read somewhere that the option -q is quiet, so no email is sent.
    the permissions of the balances file are 755.
    I have also tried:
    /usr/local/bin/php
    /usr/bin/php
    /usr/bin/local/php-cron
    /usr/bin/php-cron
    some of them will email me an error message.

    I will keep on trying a little before I seek help from the guys at x10.

    Thanks again.

  4. #4
    dmoneyman is offline x10Hosting Member dmoneyman is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    19

    Re: crontab not working

    Mine works using:

    php <filename>

  5. #5
    jtwhite's Avatar
    jtwhite is offline Community Advocate jtwhite is on a distinguished road
    Join Date
    May 2009
    Location
    TN, USA
    Posts
    1,381

    Re: crontab not working

    Are you sure your scripts are error free?

    Edit: Have you tried:

    Code:
    php /public_html/balances.php
    Last edited by jtwhite; 09-11-2009 at 04:30 PM.
    If I have helped you, please add to my reputation () on the bottom left corner of this post.
    jtwhite.me - Visit my site :D

  6. #6
    orgutz is offline x10Hosting Member orgutz is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    8

    Red face Re: crontab not working

    to Justin:
    the program balances.php runs perfectly from the browser. Also it was running in another server's crontab. I actually was running 4 programs at different times during the month. balances.php is supposed to run once every day.

    to dmoneyman:
    I tried:
    php balances.php and nothing happened.

    When entering /usr/php-cron I receive an email with:

    /bin/sh: /usr/php-cron: No such file or directory

  7. #7
    jtwhite's Avatar
    jtwhite is offline Community Advocate jtwhite is on a distinguished road
    Join Date
    May 2009
    Location
    TN, USA
    Posts
    1,381

    Re: crontab not working

    Quote Originally Posted by orgutz View Post
    to Justin:
    the program balances.php runs perfectly from the browser. Also it was running in another server's crontab. I actually was running 4 programs at different times during the month. balances.php is supposed to run once every day.

    to dmoneyman:
    I tried:
    php balances.php and nothing happened.

    When entering /usr/php-cron I receive an email with:

    /bin/sh: /usr/php-cron: No such file or directory

    But did you try:

    Code:
    php /public_html/balances.php
    ?

    I think that should work?
    Last edited by jtwhite; 09-11-2009 at 04:39 PM.
    If I have helped you, please add to my reputation () on the bottom left corner of this post.
    jtwhite.me - Visit my site :D

  8. #8
    orgutz is offline x10Hosting Member orgutz is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    8

    Red face Re: crontab not working

    Justin:

    I have tried php /public_html/balances.php and nothing happened.

  9. #9
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,633

    Re: crontab not working

    Which server are you on?

    If you get it to work, please post here what the problem was. Several people have had problems getting cron jobs to work, yet nobody seems to come back to explain how they got them to work (if they did instead of just giving up).
    Nothing is always absolutely so.

  10. #10
    orgutz is offline x10Hosting Member orgutz is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    8

    Red face Re: crontab not working

    to Descalzo:
    I am on starka. But the crontab part works. Sometimes I get an email. I think the problem is the path to the php interpreter.
    I am not ready to give up yet.
    If I get that to work I will post the solution.

Closed Thread

Similar Threads

  1. Cron Tutorial (Crontab Tutorial)
    By sunils in forum Tutorials
    Replies: 3
    Last Post: 06-14-2008, 10:34 PM
  2. Domain stopped working
    By devongovett in forum Free Hosting
    Replies: 1
    Last Post: 05-05-2008, 08:04 PM
  3. Subdomain not working
    By trogenhorse in forum Free Hosting
    Replies: 5
    Last Post: 04-28-2008, 10:57 AM
  4. ads are not working
    By rayminator in forum Free Hosting
    Replies: 5
    Last Post: 03-23-2008, 09:07 PM
  5. Site not working
    By Immortal in forum Free Hosting
    Replies: 1
    Last Post: 09-10-2005, 02:49 PM

Tags for this Thread

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