c panel cron. jobs

filoujr

New Member
Messages
5
Reaction score
0
Points
0
Hi everybody,

I have a php file that contains a function that I would like to execute every 4 hours. Does anybody think it's possible? The function in the php file update my database.

Thank you!
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Code:
/usr/local/bin/php  /home/filoujr/public_html/somefolder/mycronjob.php

With Unix timing entry:

Code:
0 */4 * * *

cPanel also has a 'Standard' tool that you can set the script to run at 0 (on the hour) and every 4 hours
 

filoujr

New Member
Messages
5
Reaction score
0
Points
0
Thank you very much! =]
Edit:
Hi,
I saw that i could use an e-mail address for the cron jobs, so i will get a message if the cron job is sucessful.
I tried to use my hotmail.com email address, but i didn't receive any message in my inbox after 8 hours of waiting.

Does anybody know if we can use external email address like hotmail.com or yahoo.com?
 
Last edited:

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
Edit:
Hi,
I saw that i could use an e-mail address for the cron jobs, so i will get a message if the cron job is sucessful.
I tried to use my hotmail.com email address, but i didn't receive any message in my inbox after 8 hours of waiting.

Does anybody know if we can use external email address like hotmail.com or yahoo.com?

Actually, the email should be sent only if
1) the cron job fails (cannot find PHP, cannot find your script, etc)
2) the program being run emits anything. Even a whitespace.

If you run a php script with

Code:
/usr/local/bin/php -q  /home/filoujr/public_html/somefolder/mycronjob.php

the 'q' flag and the script does not echo anything (or have blank spaces outside of the <?php ?> tags), then no email will be sent.

And, yes, the system (at least on Chopin) does send emails to hotmail and hotmail lets them in.
 
Top