Thank you FiveM devs for backing up files....even when I (the sysadmin managing the server) didn't! (A lesson to back that shite up!)

Okay, Let me start by saying, that I’m running my server on linux because linux is awesome and it’s a lifelong companion once you get just the basics down.

So anyways, I do a lot of handling modifications on my personal server, and today, I was playing around in handling.meta using a text editor called vim (check it out!) and I accidentally deleted some 16 THOUSAND lines out of 39k. WOW!

Of course, me being me, I didn’t realize what I had done until AFTER I saved and exited vim.

AND of course, me being even MORE me, I hadn’t made a backup of this file in a long time. I’m talking a LOOONG TIME! (Since March of 2020) - A DAMN YEAR AGO.

SCRAMBLING, I decided to start looking up ways to recover files on linux as I’m very comfortable with linux, but I don’t make mistakes like this typically so I panicked. Like HARD!

I’ve seen soo many different options of “delete this file” - “restore that,” and even the unhelpful occasional “make this file change so that you can stop this from happening in the future!”

Searching, I started getting into block dumps of my hard drive, but after ALL of the tests I’ve run to try to restore my 39k-line handling.meta, ubuntu had no longer ‘remembered’ my instance of that file or my changes made.

Pissed off, I made for the internet looking for the original file from which I’d created this; I was going to have to manually re-edit / re-create some 2000 lines that I had lost; :cry:

But something told me to do one final search: “Dump all instances of the name of the file (handling.meta) into a file called search.txt.”

After looking in there, I realized I had overlooked something.
THE FUCKING SERVER CACHE! RIGHT UNDERNEATH MY NOSE.

After navigating to the directory where the server cache lived (the one that I usually destroy), I found my data there and accounted for. And looking at the date, it was a mere 4 days old rather than 1 year meaning I had less than 10 lines to change rather than 2000. I quickly recovered, and made backups, but even BETTER yet, I’ve made multiple backups of the entire directory and of my disk in the process.

Let this be a lesson to you server owners to BACK YOUR SHITE UP! Because no matter HOW long you’ve been using your OS, stuff happens and you’d never wanna be out of data. It SUCKS!

And lastly to the profound staff / contributors to the fivem source; THANK YOU. Thank you for backing files up that I had failed to do in the first place, and thank you for coding a (while although imperfect), stable, structurally sound, and redundancy-packed code. This is the first times that the fiveM source has directly saved my bacon, and I just wanted to share how eternally grateful I am to you guys for being awesome!

Cheers!

2 Likes

Do your backup folks!
It will save you much more time in case of need then doing them :stuck_out_tongue:

1 Like

this is why I started using git

1 Like

Why the heck you didn’t use git for sourcing.
It’s beyond me.

you are the lucky one this time.

1 Like