I am writing this on Sunday because on Friday and Saturday I could not type.
What Tavolo is: table bookings for 38 restaurants at the time.
What happened, Friday 14 June:
- 17:52. I want to clean old test bookings from the staging database before the weekend.
- 17:53. I have two terminal tabs open. They look the same. They are not the same.
- 17:54. I run the clean-up script. It finishes very fast. Staging has never been that fast.
- 17:55. A restaurant in Bologna calls my mobile. Their Friday night bookings are gone.
- 17:56 to 18:40. I do not remember.
- 18:41. I look for the backup. The backup job is a cron I wrote in February. It has been failing since March with a permissions error that it emails to an address I never set up.
What I lost: every booking made after 11 March, for 38 restaurants, on a Friday evening in June.
What saved me: the confirmation emails. Every booking sent one, and my email provider keeps 30 days of logs. I rebuilt four weeks of bookings from email logs, by hand and by script, until 4 in the morning. For the older ones I phoned every restaurant on Saturday and apologised in person. Thirty-eight calls.
What I lost in the end: two customers. Thirty-six stayed. Several said the phone call was why.
What I changed:
- Production terminal has a red background now. Bright red.
- Backups are tested by restoring them, every Monday, automatically, and it posts the result where I see it.
- No clean-up scripts on Fridays. No anything on Fridays.
Please check your backups. Not that they exist. That they restore.