List all cron jobs for all users

How to view crontab for all users? Not as elegant as you probably want, but this is what I do as root.
for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
That snippet will loop over each user in /etc/passwd listing out their crontab. The crontabs are owned by the respective users so you will not be able to see another user's crontab without doing this as root. If this tip was useful to you, or you have a better way of doing the same thing, let me know by commenting below.

Related Entries

2 Comments

This is brilliant gentleman! In larger systems, I guess
it will be prettier cool to have the script do a report
(logs) then mail it over...

Good thinking Gilbert, you could mail them or maybe send them to a syslog server somehow.

Leave a comment

Recent Entries

Close