Created
May 1, 2026 14:26
-
-
Save sysbitnet/b9d9ea804ad809773c7d802eb25b6d6d to your computer and use it in GitHub Desktop.
A simple shell script helps to find all users' cron set configurations
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ########################################################################## | |
| # A simple shell script helps to find all users' cron set configurations # | |
| ########################################################################## | |
| # On cron_list.text, you can see a complete list of all cons | |
| # On userscronjobs.txt, you can see all users who use crons | |
| # | |
| #!/bin/bash | |
| cd /var/spool/cron | |
| ls -1 > /root/userscronjobs.txt | |
| for i in `cat /root/userscronjobs.txt` | |
| do | |
| echo "######For the user $i######" >> /root/cron_list.txt | |
| echo "" >> /root/cron_list.txt | |
| cat $i >> /root/cron_list.txt | |
| echo "" >> /root/cron_list.txt | |
| echo "###########################" >> /root/cron_list.txt | |
| echo "" >> /root/cron_list.txt | |
| Done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment