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 :)

Sunday, June 13, 2010

If your URL redirects to somewhere

If your URL redirects to somewhere, SetCronJob won't accept that URL to be set cron job.
You will receive message like This URL is redirected to DESTINATION URL Try setting cron with this URL.

Here are some common cases of cron URL redirection:

1. If it's a redirection from non-www to www (or vice versa), i.e. from http://yoursite.com/cron.php to http://www.yoursite.com/cron.php, then set up cron with the DESTINATION URL.

2. If it's a redirection to an error page (e.g. some shared hosting do this for 404 Not Found error), then you should check your cron URL (see below).

3. If it's a properly redirection, i.e. after your cron works, you make it redirect to homepage or somewhere, then you can use the cron.php (http://www.mediafire.com/?kymwznzmedx), change the $cron_url, upload it to your web root (i.e. can be accessed at http://yoursite.com/cron.php), then set cron job with URL to call is http://yoursite.com/cron.php
Of course, your web hosting must enable PHP.

How to check a URL for redirection?
To check a URL, simply enter it to your browser. If it redirects, you will see the new URL at address bar.

Another useful tool is web-sniffer.net: enter your URL then click Submit. You will see the HTTP status and other headers as well as the HTML output. If it redirects, you will see the new URL at Location:

If you have any question, feel free to email me.