If you've ever wondered why my home server is called tonycorev2 and not just tonycore, this is that story. It's not a good one, but it's an honest one.
It was a weekend afternoon, maybe four months ago. My daughter was in the room with me. She's four. My wife too. Nobody was doing anything wrong. They were just being around, the way families are on weekends. Talking, asking questions, making small talk. My daughter doing the thing four-year-olds do where they say "Dad" seventeen times before the actual sentence arrives.
I was at the desktop trying to focus on something. It wasn't working.
That's when the brilliant idea hit me.
If I can't focus anyway, I'll do something that doesn't require focus.
I updated my Docker stack.
At the time, tonycore was running everything on Docker Compose. Each container in its own folder under /appdata/<containername>/, with its own compose file, its own volumes, its own everything. Clean setup. Worked fine. I went through each one, cd'd in, docker pull, brought things back up. No issues. Smooth.
That should have been the end of it.
But the part of my brain that makes poor decisions was still running in the background, and it noticed something. ls /appdata/ had a few folders from containers I hadn't used in months. Old experiments. Dead projects. One of them was yt-dlp. Clutter. Might as well clean it up while I'm here, right?
So I typed:
rm -rf /appdata yt-dlp
Notice the space? Between /appdata and yt-dlp?
I didn't.
I hit Enter.
The terminal started scrolling. Fast. A wall of Permission denied errors flying up the screen. My first thought was huh, weird. Then my daughter hit me with a full-on DAD DAD DAD sequence and I looked away from the screen to answer her.
When I looked back, something felt wrong. Too much activity. Too many errors. Something in my gut said go back and read that command.
I should have stopped. I should have read. I should have done a lot of things.
Instead, I hit the up arrow, held left until the cursor was at the beginning of the command, typed sudo, and pressed Enter. To be clear, this was entirely instinct. Zero thought. Then, while half-listening to whatever my daughter was telling me about, I typed my password and hit Enter again.
The Permission denied errors stopped.
The files did not.
Here's what rm -rf /appdata yt-dlp with a space actually does. It treats both as separate arguments. It deletes /appdata, the whole thing, and then tries to delete a file or folder named yt-dlp in the current directory. The permission errors the first time were because I wasn't root. The second time, I was.
I sat there for a second just watching it go. Then I closed the terminal, leaned back in my chair, and told my daughter yes, I was listening, and yes, that sounds very interesting.
I was not listening. I was doing threat assessment.
The damage. Every Docker Compose file, every container config, every environment variable, every mounted volume, every cron job, every custom script. All gone. Home Assistant config. Frigate setup. Mosquitto. Portainer. All four web projects. The NUT UPS config managing both CyberPower units.
The actual data was fine. Media, backups, anything sitting on real storage. That lives on two separate NAS, not on tonycore. So nothing truly irreplaceable was lost.
What was lost was time. The version of that setup I'd built and tweaked over the previous couple of years.
I thought about recovering it. I probably could have pieced most of it back together from memory and documentation scattered across various notes. But I looked at the blank server, looked at my daughter who had moved on and was now doing something completely different, and made a decision.
Fresh install.
Ubuntu 24.04, clean slate. Rebuilt every container from scratch. New compose files, written properly this time. Took the chance to reorganize things I'd been meaning to reorganize. Set up actual backups. A lesson that apparently required a small disaster to stick. The new setup is cleaner than the old one. More intentional.
That's the only upside to blowing up something you built. You get to build it again knowing everything you learned the first time.
The machine is tonycorev2 now. Not because the hardware changed. It's the same Dell OptiPlex 3050 it's always been. But the name felt right. It's a different machine in the way that matters. The old one died in a distracted moment on a weekend afternoon. This one was built on purpose.
Lessons, if you want them:
- Back up your configs. Not your media. Your configs. The stuff that's annoying to recreate.
- Read the command before you run it. Especially if there are children in the room.
- sudo is not an undo button.
- And if you're going to do terminal work, maybe do it when the four-year-old is asleep.