Created
January 27, 2021 19:16
-
-
Save StudioEtrange/98298cd98767542fa8e07c00a39bf730 to your computer and use it in GitHub Desktop.
count number of active task inside of all user crontab
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
# count number of active task inside of all user crontab | |
# sample with excluding a string containing "str" | |
for c in $(sudo ls /var/spool/cron); do sudo crontab -u $c -l 2>/dev/null | grep -v -e '^$' | grep -v -e '^#' | grep -v "crontab;" | grep -v "str"; done | wc -l |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment