Web lists-archives.com

A Rather Basic Cron Question




	I use fetchmail every 5 minutes between 05:00 and 23:00
each day and I thought it might be good to suspend the fetches
between 12:00 and 13:00 since I run a half-day backup during that
time.

	The line currently reads

*/5 5-23 * * * sh -c ". $HOME/.master.env; ./etc/do_mail"

I modified it to read

*/5 5-12,13-23 * * * sh -c ". $HOME/.master.env; ./etc/do_mail"

When I tried that line, it still continued to run every 5 minutes
between 12:00 and 13:00 and I did check to see if my edit of
crontab extended past 12:00.  It was at 11:58 so the cron at
11:59 should have been running with the new crontab.

	In this case, no harm was done but shouldn't the cron
runs have stopped at 12:00 and then resumed at 13:00?

	I guess the */5 criteria is still valid until 12:55 but I
thought all of those conditions were anded and the fact that
12,13 specifically means 12:00 and then 13:00, not from 12:00
until 13:00 would cause the */5 specification to stop running.

	I've only been doing unix for 29 years so I probably
should know a lot more but there may someday be a time when this
would have been a critical problem so it is good to know now.

Martin McCormick WB5AGZ