Created
September 30, 2013 04:21
-
-
Save xhan/6759341 to your computer and use it in GitHub Desktop.
get all user's crontab list
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
for user in $(cut -f1 -d: /etc/passwd); | |
do | |
crontab -u $user -l 2>/dev/null | |
if [ $? -eq 0 ]; then | |
echo $user | |
echo "-------------------------------" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl https://gist.github.com/xhan/6759341/raw/2d1831b5fa2e38446690c0628adc3783d3fd532a/crontab_list.sh | sh