shinve — 2012-01-09T02:18:36-05:00 — #1
I need to run a script on a regular basis. It has to be compatible with php. Are there any solutions available for this? I have investigated cron, but haven't used it.
I will be using this to run a script that looks for a field in a mysql table and when that field is larger than another field, delete the row. (I am expiring user accounts.) I am completely unfamiliar with maintenance task scheduling like this. I primarily develop under windows, but my production server is LAMP.
oddz — 2012-01-09T02:38:05-05:00 — #2
Yes, a CRON job is what you would need to set-up. The only other alternative is what is a lazy mans CRON which is pretty hackish considering there is no guarantee it will run. The lazy CRON is triggered by a normal request based on some type of time frame. So if the job is suppose to run every hour the first lucky user within the hour would initiate the job when requesting a page. So depending on the task this can also make one lucky user not so happy. Most hosts have a CRON area that explains in full how to set-up an actual CRON job.