Skip to content

Instantly share code, notes, and snippets.

@kawaz
Created March 15, 2013 16:56
Show Gist options
  • Save kawaz/5171356 to your computer and use it in GitHub Desktop.
Save kawaz/5171356 to your computer and use it in GitHub Desktop.
crontab -r で r は e の隣のキーだから危険ってやつ。実際のところ -r に打ち間違えたことは無いんだけど保険としてこんなスクリプトをいつも使ってる。
# save /etc/profile.d/seal-crontab-r.sh or append to ~/.bashrc
# crontab -r を封印する
function crontab() {
local opt
for opt in "$@"; do
if [[ "$opt" == "-r" ]]; then
echo '-r is sealed!'
return 1
fi
done
command crontab "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment