php script for cronjob

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hame22
Forum Contributor
Posts: 214
Joined: Wed May 11, 2005 5:50 am

php script for cronjob

Post 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
User avatar
stereofrog
Forum Contributor
Posts: 386
Joined: Mon Dec 04, 2006 6:10 am

Post 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.
Post Reply