Monday 15 September 2008

Simple scheduling in Windows

I have tried to become friends with the scheduling service in Windows but I guess it just does not like me. It was as simple as running a little command file that would make a backup of a wiki I have set up locally. I struggled over a period of several months to get it working but it was always something with the accounts and privileges that made it fail. When I finally got it to work I had to changed my password on the system and the backup stopped working, silently of course. I finally gave in and started to look for some other solution.

What I found was cron which a really simple freeware program that just does the job. It is a clone of the Unix cron so it uses a similar configuration file and it also has a log file which logs every attempt to start a job and the result. I just dropped a shortcut in the Windows Startup folder for it to start at boot time and it worked from day one. I could forget that it even had it running, which I actually did until the day I got a new computer and had to migrate my environment.

I made a mistake and put the backup command file in another location on the new machine and forgot to update the crontab file. When I did my usual check if the backup was working, which the Windows scheduler had taught me was a good idea, I realised my mistake and corrected it. I also had a look at the log file which showed that the backup has been running flawlessly since the day I set it up with cron, well until the system was migrated over which I also could see in the log. Now it works flawlessly again.

This is a good example of less is more. Simplicity rules.