resolvecron.pl
Copyright (C) 2011 Robert Marxreiter
Licensed under the Apache License, Version 2.0
http://www.apache.org/licenses/LICENSE-2.0
This script resolves cron entries to the timebase. Its intention is to get a better overview when which cronjobs are being run.
Since it is impossible to properly sort complicated crontabs, this script can be of great help to find out whether everything is going as planned.
The script takes cron entries from standard in and outputs all scheduled execution times of all active jobs starting with the present day up to the end of the next month to standard out.
Example:
$ crontab -l | ./resolvecron.pl | sort | less
For big crontabs with lots of frequently running jobs the output can be quite big, so you should filter out jobs you are not interested in.
Examples:
$ crontab -l | grep -vE "^\s*\s+\s+" | ./resolvecron.pl | sort | less
This filters out jobs that are running every minute on at least one day.
$ crontab -l | grep "interesting_job" | ./resolvecron.pl | sort | less
This one looks for cron entries containing a specific string.
You can also do magic to get an overview over multiple hosts:
for host in host1 host2 host3 host4; do ssh $host crontab -l | ./resolvecron.pl | sed -r "s/^(\S+ \S+) (.+)/\1 $host: \2/;"; done | sort | less