Skip to content

Instantly share code, notes, and snippets.

@sysbitnet
Created May 1, 2026 14:26
Show Gist options
  • Select an option

  • Save sysbitnet/b9d9ea804ad809773c7d802eb25b6d6d to your computer and use it in GitHub Desktop.

Select an option

Save sysbitnet/b9d9ea804ad809773c7d802eb25b6d6d to your computer and use it in GitHub Desktop.
A simple shell script helps to find all users' cron set configurations
##########################################################################
# 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