Skip to content

Instantly share code, notes, and snippets.

@dmolesUC
Created November 3, 2020 22:30
Show Gist options
  • Save dmolesUC/f40804df40a2d3125a10ed114a33d2c1 to your computer and use it in GitHub Desktop.
Save dmolesUC/f40804df40a2d3125a10ed114a33d2c1 to your computer and use it in GitHub Desktop.
List all crontabs
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
#!/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