Page 1 of 1
PHP cronjob
Posted: Tue May 12, 2009 5:06 pm
by JKM
How do I run a php script in cronjob (the php script contains only mysql queries)?
Re: PHP cronjob
Posted: Tue May 12, 2009 5:47 pm
by pickle
You'll have to put a shell command inside your crontab file. Usually that can be done by calling crontab -e as root. Alternatively, you can make your PHP file executable, and put it in the appropriate cron.daily, cron.hourly, etc directories (if your Linux distro has those directories).
Re: PHP cronjob
Posted: Tue May 12, 2009 5:50 pm
by Eran
If the queries are static, you can use the MySQL event scheduler instead -
http://dev.mysql.com/doc/refman/5.1/en/events.html
Re: PHP cronjob
Posted: Tue May 12, 2009 6:27 pm
by ldougherty
If you do have access to cron tab then the following URL will prove useful as it will walk you through creating the cron job from start to finish
http://www.astahost.com/info.php/Cron-J ... t2324.html
Re: PHP cronjob
Posted: Wed May 13, 2009 7:13 am
by JKM
Thanks, mate!