Toxic Elephant

Don't bury it in your back yard!

crontab -r

Posted by matijs 20/03/2007 at 18h27

I don’t use the crontab command on my own machines (I just put files in /etc/cron*), but recent experience on another machine made me wonder why crontab has the following options (this is from crontab --help):

    -e      (edit user's crontab)
    -l      (list user's crontab)
    -r      (delete user's crontab)

Right. E is for edit, L is for list, R is for delete. Makes sense. And as a bonus, it is easier to accidentally delete your crontab when you want to edit it.

Brilliant.

Tags 2 comments no trackbacks

Comments

  1. Jurjen said 21/03/2007 at 22h02:

    It's the help text that is deceiving, I think it should be: "-r (remove user's crontab)" Besides that I fail to see a problem, other than you ignoring the case sensitivity of the OS commands in your comment :-) That is, unless you whished to do something recursively with your crontab and thus deleting it.
  2. Matijs said 25/03/2007 at 12h46:

    @Jurjen: Well, I cheated a little of course, because the man page does say remove. Call it poetic license. I'm mainly stunned that the most-used option and the most destructive option are one fat-fingered typo away from each other. `-d` would have already been better, but when a program has only three options, why not use, e.g., `-e`, `-l` and `-x`?

Comments are disabled