Don’t Use The `-r` Flag with Crontab…On Accident

So I was going to edit my crontab on the production server but found out something I probably should have known but didn’t. I accidentally hit the `r` key instead of the `e` key (fat fingered it) and low and behold my crontab disappeared. Luckily for me I had run `crontab -l` right before running `crontab -r` so I was just able to copy and recreate it.

Checking the manual (man crontab) on the cli shows:

-r    Remove the current crontab.

Why put the edit and remove command next to each other on the keyboard?

Don’t be like me and make that mistake.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.