Help setting a cronjob up.

tomfordx

New Member
Messages
4
Reaction score
0
Points
0
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!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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.
 

tomfordx

New Member
Messages
4
Reaction score
0
Points
0
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...
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
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:

misson

Community Paragon
Community Support
Messages
2,572
Reaction score
72
Points
48
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.
 
Top