I am running RHEL5 and software RAID (mdadm). Currently I allow the 99-raid-check weekly cron script to run at the normal time (early Sunday morning). However, if the system is off during that time it will run when the system boots with a delay. Looking at the man page for anacrontab and /etc/anacrontab, I can see the current config is set to run every 7 days with a delay of 70 minutes for the cron.weekly scripts. I need to be able to predict when there will be high disk IO, so I want it to run early Sunday morning if it's on, or not at all. My question is, how can I prevent 99-raid-check just to wait until the following week to run and not utilize anacron?
The simplest option would be to modify your script to check for I/O load and only run if it is below a threshold. Use something like