Skip to content

Instantly share code, notes, and snippets.

@StudioEtrange
Created January 27, 2021 19:16
Show Gist options
  • Save StudioEtrange/98298cd98767542fa8e07c00a39bf730 to your computer and use it in GitHub Desktop.
Save StudioEtrange/98298cd98767542fa8e07c00a39bf730 to your computer and use it in GitHub Desktop.
count number of active task inside of all user crontab
# 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