Warning: preg_replace(): Compilation failed: escape sequence is invalid in character class at offset 4 in /home/customer/www/theunixtips.com/public_html/wp-content/plugins/resume-builder/includes/class.resume-builder-enqueues.php on line 59

cron : List users who have cron jobs scheduled

In multi-user systems with no restrictions on who can and who cannot schedule cron jobs, things could go out of hand pretty quickly. So it is advisable to check time to time who is running what to ensure that not many users are running cpu intensive operations or they are not stepping on each others’ toes and end up wasting CPU.

To find who has cron jobs scheduled on a system there is no built in command. There is a workaround though. But you have to be superuser or root for this. /var/spool/cron directory contains one file for each user (the file is named as the user) that has any cron job scheduled. So a simple ls /var/spool/cron will provide the list of users that have cron jobs scheduled in the system.

Each file in /var/spool/cron contains what is available from crontab -l for that user. Any edits of the files in this directory or via crontab -e for the corresponding user have the same effect. Removing a file from here is equivalent to crontab -r for the corresponding user.