Page 1 of 1

php script for cronjob

Posted: Wed Mar 14, 2007 4:59 am
by hame22
Hi

I am in the process of writing a maintence script to run through my site making a number of mysql queries that remove unwanted data and files.

Is there any difference in writing code for cronjobs compared to standard web pages and if so what should I be aware of?

Thanks in advance

Posted: Wed Mar 14, 2007 5:13 am
by stereofrog
There's nothing special about writing php-cli scripts except that parameters come from $_SERVER['argv'] instead of $_REQUEST.
"Using PHP from the command line" in the manual discusses CLI in details.