CRON : how to use?

ultra

Verified User
Joined
Sep 29, 2005
Messages
6
Location
my
how do i create a cron job to run a file every 5 minutes ?
file dir : rs/filez/b/run.php

currently i have thi
*/5
*
*
*
*
/home/ultra/domains/rogenwar.com/public_html/rs/filez/b/run.php

but it doesn't seems to work?
 
Your timing is correct, but make the command line:

php /home/ultra/domains/rogenwar.com/public_html/rs/filez/b/run.php > /dev/null
 
i have tried the line you gave but it still doesn't work? anymore idea?
 
vi /etc/crontab or vi /etc/cron.txt and if you use cron.txt do not forget to run crontab cron.txt

Run file every 5 minutes:
*/5 * * * * curl -s -o /dev/null http://www.your_domain/file.php
or
*/5 * * * * php -q -f /home/ultra/domains/rogenwar.com/public_html/rs/filez/b/run.php
 
Last edited:
is it correct that
0 0 * * *
will run at 0:00 time every day?
 
hostpc.com said:
Your timing is correct, but make the command line:

php /home/ultra/domains/rogenwar.com/public_html/rs/filez/b/run.php > /dev/null

try the line
Code:
/usr/local/bin/php -c /home/ultra/domains/rogenwar.com/public_html/rs/filez/b/run.php > /dev/null

Specifying the full path to PHP normally fixes the problems.

Also you need the first line of your PHP script to be

Code:
#!/usr/local/bin/php

Regards,
Onno Vrijburg
 
Back
Top