I'm trying to get all cron jobs in the current week (or from monday to sunday) ordered by schedule time.
I'm trying with some elaboration on the output of the command
crontab -l
I appreciate any smarter solution.
I'm trying to get all cron jobs in the current week (or from monday to sunday) ordered by schedule time.
I'm trying with some elaboration on the output of the command
crontab -l
I appreciate any smarter solution.
Starting with the command:
for user in $(cut -f1 -d: /etc/passwd); do echo "### Crontabs for $user ####"; crontab -u $user -l; done
You should be able to see crontabs for each user. As for the actual sorting by time, I think you're going to have to pass that output into a Perl or BASH script and parse it yourself. I'd love to see what you come up with in the end.Honestly, I use Icinga to monitor my server for me, and that is based not on scheduled events but on events that have already happened. I would suggest then if that is good enough for you, where you want to see what happened, but not predict further jobs, then just use and parse
grep CRON /var/log/syslog
. You'll be able to see all the cron jobs dating back for quite some time.