Created
November 27, 2022 19:41
-
-
Save secemp9/0b24cb31444a7f3069df5efaddc924e2 to your computer and use it in GitHub Desktop.
start crontab with the given command (deduplicate entries too)
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
cronadd() { | |
if crontab -l | grep -wq -- "$@"; then | |
: | |
else | |
(crontab -l 2>/dev/null; echo "$@") | crontab - | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment