+ Reply to Thread
Results 1 to 6 of 6

Thread: Help setting a cronjob up.

  1. #1
    tomfordx is offline x10Hosting Member tomfordx is an unknown quantity at this point
    Join Date
    Jan 2012
    Posts
    4

    Help setting a cronjob up.

    I am trying to run a cron every 10 minutes. Now I have tried several commands to get this to work but each time it doesn't! I can run the code manually perfectly fine. So it has to be down to the commands I am using. So could someone please help me with the commands used. The path I am using is: /home/<username_here>/public_html/alpha/turn.php

    Thank you!

  2. #2
    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,636

    Re: Help setting a cronjob up.

    Code:
    /usr/bin/php -q  /home/igor/public_html/alpha/turn.php >>/home/igor/public_html/alpha/cron_log.txt 2>&1
    this way any output/error messages get put into cron_log.txt for debugging, etc.
    Nothing is always absolutely so.

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

    Re: Help setting a cronjob up.

    See also the X10 wiki article on cron jobs.
    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.

  4. #4
    tomfordx is offline x10Hosting Member tomfordx is an unknown quantity at this point
    Join Date
    Jan 2012
    Posts
    4

    Re: Help setting a cronjob up.

    Code:
    /usr/local/bin/php -q  /home/tomfordx/public_html/alpha/turn.php >>/home/tomfordx/public_html/alpha/cron_log.txt 2>&1
    I used the above command, yet I fail to get an output or error message in the cron_log.txt. It is as if the cron is not even running to start with...

  5. #5
    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,636

    Re: Help setting a cronjob up.

    1. Try putting an

    echo "it ran"

    line in your script

    2. What is the time part of the cron command look like?

    3. Alternatively, misspell the script name and see if that produces an error message.
    Last edited by descalzo; 01-17-2012 at 04:26 PM.
    Nothing is always absolutely so.

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

    Re: Help setting a cronjob up.

    Slightly off-topic, note that you should place the script under your web folder only if the script should also be accessible as a web page. If not, place it elsewhere under your home folder.
    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

Similar Threads

  1. Cronjob
    By codeman_nz87 in forum Free Hosting
    Replies: 1
    Last Post: 07-24-2011, 06:19 PM
  2. Please HELP how to use cronjob
    By vhadz in forum Programming Help
    Replies: 2
    Last Post: 05-28-2010, 08:55 AM
  3. Why use cronjob
    By centbux in forum Free Hosting
    Replies: 1
    Last Post: 10-20-2008, 04:47 PM
  4. cronjob won't run
    By stocks in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 04-11-2008, 08:04 PM
  5. Cronjob
    By yuriman in forum Free Hosting
    Replies: 3
    Last Post: 03-23-2008, 05:08 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