Skip to content

Instantly share code, notes, and snippets.

@ameesters
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ameesters/9048199 to your computer and use it in GitHub Desktop.
Save ameesters/9048199 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Colors
ESC_SEQ="\x1b["
COL_RESET=$ESC_SEQ"39;49;00m"
COL_RED=$ESC_SEQ"31;01m"
COL_GREEN=$ESC_SEQ"32;01m"
COL_YELLOW=$ESC_SEQ"33;01m"
COL_BLUE=$ESC_SEQ"34;01m"
COL_MAGENTA=$ESC_SEQ"35;01m"
COL_CYAN=$ESC_SEQ"36;01m"
if [[ $EUID -ne 0 ]]; then
echo -e "$COL_RED This script must be run as root! $COL_RESET" 1>&2
exit 1
fi
for user in $(cut -f1 -d: /etc/passwd);
do echo -e "$COL_MAGENTA $user: $COL_RESET";crontab -u $user -l;
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment