Created
November 3, 2020 22:30
-
-
Save dmolesUC/f40804df40a2d3125a10ed114a33d2c1 to your computer and use it in GitHub Desktop.
List all crontabs
This file contains 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
getent passwd | cut -f1 -d: | while read user; do crontab=$(sudo crontab -u $user -l 2>/dev/null) && echo -e "\n$user:\n$crontab"; done |
This file contains 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
#!/usr/bin/env bash | |
getent passwd | cut -f1 -d: | while read user | |
do | |
crontab=$(sudo crontab -u $user -l 2>/dev/null) && echo -e "\n$user:\n$crontab" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment