Wednesday, June 30, 2010

If you need cron jobs every X seconds

At the moment, there's no cron job service supports cron jobs with interval less than 1 minute. If you're really in need of cron jobs every X seconds and your hosting supports PHP, you can use my cron.php (http://tinypaste.com/7bcc5).

First, edit the $cron_url, $time_interval, $real_time_interval. Then upload cron.php to your web root, i.e. can be accessed at http://yoursite.com/cron.php

Set cron job with URL to call http://yoursite.com/cron.php to run every minute.

Hope it helps :)

4 comments:

  1. Thanks - very good idea. Unfortunately my hosting provider limits php execution time to 30 seconds - but in other situations this would do the job fine :-)

    ReplyDelete