my avatar, a simple three line smiley face backup your data!

Don't be like me. I was the person who wrote all the measurements of an uni lab exercise into a LibreOffice Calc sheet. We also exported some screenshots from the oscilloscope.

I was the person who also wanted to send our data to the others in my group. Because they aren't linux users, I thought "well, send them a zip archive instead of a tar file". And this was where the trouble started.

Being the linux user I am, I used command line tools. So I wrote zip data/* lab.zip, with the intention of adding everything in the data folder to a zip archive called lab.zip.

Well, I had to quite painfully learn that the zip command takes the first argument as the name of the zip file, not the last argument. In my case, the first argument was the LibreOffice Calc sheet with all the measurement data.

As you can imagine, I was quite distressed. I just overwrote all measurements we did in that lab. Or so I thought!

You see, LibreOffice Calc saves its files as .ods files, which are some fancy kind of zip archives! (.xlsx files are too, you can unzip them and poke around!) So what the zip command did was adding the other files in the folder to the .ods file! That just corrupted the file!

And, thank god, LibreOffice was able to repair the corrupted file. I have to say, that was a roller coaster of emotions. In the time span of just a few minutes, I went from pretty relaxed to shouting my soul out of my body to immense relief. Adrenaline was definitely pumping.

First thing I did after that was creating a git repository and commiting everything. If I had that before, I could just roll the changes back and everything would be fine again. Next step: Upload to some git forge, so your computer could catch fire and the data is still save in someone else's cloud.

What did we learn? Backup your data! Use any tool, something like git, restic, some cloud sync with snapshot support, just please, for the love of god, don't be as stupid as I was. I had a lot of luck that the file was just corrupted, not deleted.

Backup. Your. Data.