Virtual Crontab - Run Scheduled Tasks WITHOUT Crontab!
April 27th, 2006 by admin
One of the drawbacks in using a shared server is you rarely have access to Crontab. What is Crontab? Crontab is a program that allows you to execute programs on a schedule. These are referred to as jobs or tasks. If you use a Windows machine, you may be familiar with the Windows Scheduler. Crontab is basically the same thing.
This comes in very handy for many reasons. Perhaps you have written a CGI or PHP script that reads the server load, and will notify you by email if that load is high. It doesn’t do you much good unless it runs every few minutes. With Crontab, you can execute it as often as you wish.
What do you do if you have no access to Crontab? Well, many server admins would rather not give access to their users because almost any command can be issued from it. Of course, almost any command can be issued in a Perl or PHP script, but we can save that for another article. There is an alternative! A free PHP script called Virtual Crontab. This script is the next best thing to Crontab and runs almost exactly like it.  Using your web browser, you can schedule tasks to execute at any time of the hour, day, and month.
Many PHP scripts run certain processes on a schedule. For example, the popular Vbulletin forum software has a section called “Schedules Tasks” where certain operations are run at certain times. One task is to recount all of the posts, and all of the users. Since this is a bit CPU intensive, it is only run about once per hour. The problem is, it requires a user activate the script before the action can take place. With Virtual Crontab, you can set up a task to call the URL to the script, in essence activating it.
If your PHP installation has not restricted access by turning safe mode on, you can even execute software and commands on the server.
For those of you who do not have access to Crontab, or are baffled by how it works, Virtual Crontab is the answer!
This entry was posted on Thursday, April 27th, 2006 at 11:24 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.