Cron for Windows
Saturday, April 29th, 2006While working on one of my web servers, I came up against a problem that required me to run a script every hour. However, due to the limitations on the NT Task Scheduler, I would have had to enter 24 different scheduled tasks to accomplish this. That is when I figured someone had to have written a “cron-like” scheduler for NT.
After a little research on the web, I found NT Cron, which was exactly what I needed. After a quick look at the documentation I knew that this was exactly what I needed. NT Cron runs from a crontab file just like its Linux counterpart, and allows you to run tasks pretty much however you want, down to every minute if you want too.
NT Cron comes in two distributions. One that runs as a standalone application, and one that runs as a service. Since this was as server I was installing on, I choose the service version. I then installed NT Cron following the supplied instructions and created my crontab file. Within a matter of minutes Cron was off and running, and running my scheduled task every hour.
The Crontab file has a line for each task that follows this format.
(Minute) (Hour) (Day) (Month) (Day of Week) (Command line)
Examples:
execute the program backup.bat every hour
0 * * * * backup.bat
copy some files every half hour
0,30 * * * * xcopy c:\docs\*.* y:\users /s
Tweet This