SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Nov 2011
    0 Post(s)
    0 Thread(s)

    Running a script regularly

    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.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Augusta, Georgia, United States
    16 Post(s)
    3 Thread(s)
    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.
    The only code I hate more than my own is everyone else's.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts