Is my cron facility on ?

Status
Not open for further replies.

stevon

New Member
Messages
6
Reaction score
0
Points
0
Hi
I installed a cron script, which is meant to trigger a php file.
I set cPanel to email each time but i get nothing.

how can i tell if cron is activated for me?

steve
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
A cron command like:

Code:
/usr/bin/php /home/igor/public_html/my_cron_script.php >>/home/igor/public_html/my_cron_log.txt 2>&1

will log system error messages and any output ( print or echo commands).

Adding lines like

PHP:
date_default_timezone_set('America/Los_Angeles');
echo "\nCron job run on: " ;
echo date('l jS \of F Y h:i:s A'); 
echo "\n";

will give you a time stamp in the log file.

The email notification system on the cPanel screen for cron jobs has been turned off (it would flood the email server).

Note: PHP mail() under cron does not work, period. The above logging should show you the error message.

And remember, you cron jobs must be 5 minutes apart. Otherwise the system will quietly delete them.
 

stevon

New Member
Messages
6
Reaction score
0
Points
0
thats marvelous! thanks. works perfectly.

a small question.
i have a small site that stores user data to mysql, once an hour, i wanted to be notified if there was new data that had been written to the db.

what do you think i should be looking at to get this achieved.

regards

§teve
 
Status
Not open for further replies.
Top