Skip to content

Instantly share code, notes, and snippets.

@markeganfuller
Created January 8, 2014 11:00
Show Gist options
  • Star 10 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save markeganfuller/8315094 to your computer and use it in GitHub Desktop.
Save markeganfuller/8315094 to your computer and use it in GitHub Desktop.
Disable crontab -r (remove)
# Disable crontab -r
function crontab ()
{
# Replace -r with -e
/usr/bin/crontab "${@/-r/-e}"
}
@davidraedev
Copy link

+1000 for this. Just learned about the -r flag the hard way.

@gondo
Copy link

gondo commented Jan 7, 2017

how to use this? where to place it?
desired outcome is running crontab -r in shell would not result in deleting crontab tasks. it can output warning message this is not what you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment