The Day I Wiped My Crontab

Delete it by accident and you're fine: a Git backup is the safety net that catches the falling tasks
Delete it by accident and you're fine: a Git backup is the safety net that catches the falling tasks

crontab -r has no confirmation prompt. The moment you press Enter, every scheduled task is gone. And on the keyboard, -e (edit) and -r (remove) are right next to each other. This "accidental wipe" happens so often that it is a well-known accident among system administrators.

That's why many operations teams store their crontab contents in a Git repository. When disaster strikes, crontab backup-cron.txt restores everything in a second. The crontab file command is exactly that recovery mechanism, the safety net that turns a catastrophe into a minor inconvenience.

The best defense against human error isn't caution. It's a system that makes recovery trivial.