Posted July 7, 2006 at 08:07pm in
Computers
Anyone who has ever needed to schedule a task in windows has either been restricted to once a day (unless you create multiples) or they have an application running in their system tray that has its own little features to help bloat the code and memory usage. If you have ever used Unix/Linux you know cron has all the features that Task Scheduler needs. There are a few applications out there, but most I have tried just don’t cut it. Well thanks to Gerhard Kalab, there is pyCron. When you install pyCron it will install the files in the directory of your choice and also install a system service, which you can then change to run manually or automatically. Before you can really start you need to rename crontab.txt.sample and pycron.cfg.sample, just remove .sample. The next step is to open the pyCronEditor.exe. In the image below you can see how easy it is to add, edit, and remove entries. I have removed entries from mine, your install will show a number of samples for you to use.

This image also shows that by pressing the Wizard button next to minute you can select how often you would like it to run. You can select only 2 so that it runs on the second minute of every hour or hit every 5 and it will have it run the cron every 5 minutes.
Now if you are not familiar with crontab files the next section is going to be a little confusing. Basically you have a plain text file with lines defining what actions cron should take and when to take them.
Example 1: This line tells cron to execute RUNIT.bat every hour with the command parameter ‘testme’
0 * * * * "C:\\cron\\RUNIT.bat" testme
Example 2: Lets say you would like to have RUNIT.bat execute every 20 minutes, but only on friday.
0/20 * * * Friday "C:\\cron\\RUNIT.bat" testme
Each space seperates the definitions of the action:
Column 1: Minute
Column 2: Hour
Column 3: Day
Column 4: Month
Column 5: Day of Week (you can change this to 0-6 in the .cfg)
Column 6: Command
Column 7: Command Parameters
I realize I am not going into great detail on all of the different ways you can configure an action, maybe I will write a little tutorial on crontab files.
Now combine this with some command line php, python, or even just a Windows batch and you have a very powerful tool at your finger tips. I will go over using PHP CLI at a later date, but it is the language I write a number of my command line apps in. I promise I will write an Web interface for pyCron just as soon as I get some free time.
I have used THOUSANDS of programs over the years, on a day to day basis I use a couple hundred, and this is one of my favorites, AND I JUST GOT IT.