cron

Status
Not open for further replies.

vash112789

New Member
Messages
5
Reaction score
0
Points
0
i have been attempting to get cron to work and it does not seem to execute anything, is there an example of the commands i need for both cron to launch and if i need to add a line to my file if yes what are exact paths, also is cron even available on free hosting accounts also im doing this on the server Stoli incase theres any server specific reasons
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
Code:
/usr/bin/php /home/igor/public_html/cronjob.php >> /home/igor/public_html/cronlog.txt 2>&1

replacing 'igor' with your cPanel username

cronjob.php:

PHP:
<?php
date_default_timezone_set('America/Los_Angeles');
echo date('l jS \of F Y h:i:s A'); ;


exit();
?>

will print the time/date to the cronlog.txt

Set for every 5 minutes to test, and you can see if crons are running. (remember to delete cron job or set it to something like twice a day to monitor the cron daemon).

When you put in your own script, any output will go to cronlog.txt, including error messages (like misspelling your script, or moving it, or bad permissions, etc).
 

vash112789

New Member
Messages
5
Reaction score
0
Points
0
ok i tried using both the code segments you gave me replacing igor with my home directory username and giving execute permission to the php file and write permission to everyone for the cronlog text file set cron to run for every 5 minutes for half an hour and nothing was displayed in the text file, also tested intervals of 6 minutes for another half an hour i have no other cron jobs in the list either still not having any luck with it
 

descalzo

Grim Squeaker
Community Support
Messages
9,372
Reaction score
326
Points
83
Seems the cron daemon had died. It should be working now.

If this happens again, run the test script to make sure it is the daemon, and then your quickest response will probably be to click on 'Chat' at the top of the page and tell someone on IRC.
 
Status
Not open for further replies.
Top