I'm not aware of a standard package implementing this feature.
You can, of course, create a root cron job that checks and "fixes" user cronjobs. Take the following script for example - it's untested mostly, but it worked with the couple of examples I threw at it.
#!/bin/bash
min=16 # the minimum allowed interval between runs
for crontab in /var/spool/cron/crontabs/*
do
cp $crontab $crontab.bak
# replace the * * * * * jobs with */16 * * * * jobs.
sed -i "s/\* \* \* \* \*/\*\/16 * * * */" $crontab
for i in `seq 1 $min`
do
# replace */N * * * * for every N <= min
sed -i "s/\*\/$i \* \* \* \*/*\/16 * * * */" $crontab
done
done
This assumes the crontab fields are separated by spaces, which may not be true - I used that assumption to keep the regex (hopefully) understandable. To make it more robust replace all spaces within the left-hand regexes with \s
, if your sed supports it, or [ \t]+
(I think) if it doesn't.
Do note that the example applies 17 different search-and-replaces over each crontab, which of course will probably be unacceptable when the number of crontabs increases. To alleviate this issue you can use a single regex to match all possible infringing cronjobs. For example something like (untested): \*(/[0-9][0-5])* \* \* \* \*
or a procedurally constructed one using the output of seq -s '|' 0 $min
. Let me know if you need help with that.