[HOW TO] list all cron jobs for all users

To show the list of cron jobs you can run crontab -l, which only shows the cronjobs of the current user. To list all cronjobs for all users you can write a bash script and run it as superuser:


#!/bin/bash
#List all cron jobs for all users
for user in `cat /etc/passwd | cut -d":" -f1`;
do 
crontab -l -u $user;
done

Site refer:  http://www.linux-faqs.info/bash/list-all-cron-jobs-for-all-users

Thank you for reading this article, please a comment if you are interested.
Tiến Phan - R0039
Knowledge is Endless
Sharing for Success

0 nhận xét:

Post a Comment