Last active
November 21, 2019 17:16
-
-
Save grational/59b84a7eec106b1b85291361194a7d30 to your computer and use it in GitHub Desktop.
It's a simple crontab wrapper to avoid discarding your crontab file by mistake
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
#!/usr/bin/env bash | |
set -euo pipefail | |
crontab_bin=/usr/bin/crontab | |
if (( ${#@} != 1 )); then | |
echo 1>&2 "${0##*/} <param>" | |
exit 1 | |
fi | |
if [[ $1 == '-r' ]]; then | |
$crontab_bin -e | |
else | |
$crontab_bin $* | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment