Rescheduling ISC cron jobs

We have a SLES server running at work and recently we’ve had issues with the groupware server failing to respond during certain hours of the day. After some sleuthing I found out that it is caused by the backup scripts for the database server. At first glance you might think that the database is being locked during the backup process but it happens even if I’m just copying the (transaction) log files using cp so I’m blaming it on the really slow drives in that particular server.

Now I wanted to reschedule the cron jobs so at least they would run the backups during off hours but no matter how much I googled I couldn’t find any good information on how to do this. The server is running ISC cron and the crontab only points to run-crons which in turn executes the scripts in /etc/cron.{daily|weekly|monthly}. After some more manual labor I found out run-crons is just a script and as it turns out it simply touches files in /var/spool/cron/lastrun whenever it runs a job in order to keep tack of when to run it again.

I’ve never had to fake creation times of files in a Unix system so again I turned to Google and apparently the answer is really quite simple. The touch command has an option, -t, which allows you to set the timestamp of the files rather than just fetching the current system time so I just modified the time of the cron files to some nice value in the middle of the night when very few people access the groupware system and vĂ³ila, problem solved!