PHP cronjob
Moderator: General Moderators
PHP cronjob
How do I run a php script in cronjob (the php script contains only mysql queries)?
Re: PHP cronjob
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).
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Re: PHP cronjob
If the queries are static, you can use the MySQL event scheduler instead - http://dev.mysql.com/doc/refman/5.1/en/events.html
-
ldougherty
- Forum Contributor
- Posts: 103
- Joined: Sun May 03, 2009 11:39 am
Re: PHP cronjob
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
http://www.astahost.com/info.php/Cron-J ... t2324.html