Skip to content

Instantly share code, notes, and snippets.

@shiraji
Last active December 23, 2015 19:59
Show Gist options
  • Save shiraji/6686785 to your computer and use it in GitHub Desktop.
Save shiraji/6686785 to your computer and use it in GitHub Desktop.
crontab -rを使えなくする。
alias crontab=crontabl
# crontab設定後crontab -lをする
function crontabl() {
if [ $# -gt 1 ]; then
# 複数パラメータがある場合はそのまま。
\crontab $@
else
if [ "$1" != "-r" ]; then
if [ "$1" != "-l" ]; then
\crontab $1;
fi
\crontab -l;
else
echo "'crontab -r' is not acceptable "
fi
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment