Scheduling MT4 Posts Sans Cron
As you may know, Movable Type 4 allows you to schedule entries for future posting so that when the time comes, they're automatically posted to your blog site.
This allows you to:
Unfortunately, not all web hosts allow you to open a shell to start the "run-periodic-tasks" script as a daemon, nor do all web hosts allow you to add cron job scripts.
Your web host may instead allow you to specify a web address to visit at specific intervals. With the following short little script, you can call MT4's "run-periodic-tasks" script whenever the script is visited as a web page:
Yes, it's that short. Name it "MT-run-periodic-tasks.php" (or whatever suits you best), and place it in the root folder of your blog so that "MT," the directory where MT4 is installed, is a subdirectory. You can actually place "MT-run-periodic-tasks.php" anywhere you like as long as it's accessible from a web browser, but then you'll have to change the path in the above script.
If your path to MT4 is www.example.com/MT/, then you should now be able to execute the scheduling script by visiting www.example.com/MT-run-periodic-tasks.php. This is also the URL you insert in your web host's periodically visited web address, if your web host provides such a service.
You can use this trick even if your web host doesn't offer any kind of cron job service whatsoever. Just find a free cron job service online, such as WebCron, Web Service Scheduler, or remote-CRON, or pay a limited amount for a similar service at, e.g., WebBasedCron, and have this service call your script.
This allows you to:
- Publish your entries at a steady state even if you're not at the computer; for example by writing a number of entries in advance, and have them published automatically after you've gone on vacation, or
- Write your entries while at work, scheduling them for publishing after you've come home. (Not that I'd recommend this, but your mileage in terms of job security may vary.)
Unfortunately, not all web hosts allow you to open a shell to start the "run-periodic-tasks" script as a daemon, nor do all web hosts allow you to add cron job scripts.
Your web host may instead allow you to specify a web address to visit at specific intervals. With the following short little script, you can call MT4's "run-periodic-tasks" script whenever the script is visited as a web page:
<?
passthru( "cd MT/tools; ./run-periodic-tasks -verbose" );
?>
Yes, it's that short. Name it "MT-run-periodic-tasks.php" (or whatever suits you best), and place it in the root folder of your blog so that "MT," the directory where MT4 is installed, is a subdirectory. You can actually place "MT-run-periodic-tasks.php" anywhere you like as long as it's accessible from a web browser, but then you'll have to change the path in the above script.
If your path to MT4 is www.example.com/MT/, then you should now be able to execute the scheduling script by visiting www.example.com/MT-run-periodic-tasks.php. This is also the URL you insert in your web host's periodically visited web address, if your web host provides such a service.
You can use this trick even if your web host doesn't offer any kind of cron job service whatsoever. Just find a free cron job service online, such as WebCron, Web Service Scheduler, or remote-CRON, or pay a limited amount for a similar service at, e.g., WebBasedCron, and have this service call your script.
If you liked this post, share it with others:
Categories
Internet0 TrackBacks
Listed below are links to blogs that reference this entry: Scheduling MT4 Posts Sans Cron.
TrackBack URL for this entry: http://blog.blazingangles.net/MT/mt-tb.cgi/41






















Leave a comment