Live data from Hacker News

Ooops.

github.com

171–180 of 247 posts

Re: Ooops.

#171
post #163

I've done a similar thing a few years ago when I was first starting work on my guild hosting company's code. At the time, the main thing hosted on that machine was my WoW guild's website, which I had been working on for close to a year, and was beginning work on converting the site over to a general purpose guild hosting site. I was doing some work for a client, setting up a mirror of sorts for some kind of yearbook…

I've done a similar thing a few years ago

Ha - I'll bet everybody here has a story that starts like that. (Although your heroic save was heroic!)

My sad delete story was in 1982 - I had a fantastic graphical robot-vs.-robot game stored on tape on an HP portable computer (I was in high school). For some reason, the delete command on the HP had a variant that deleted from a given block forward on the tape, as I recall, and for some other reason, my fingers just decided to type that variant even though I had never done it before.

I still miss that game. It just may have grown in my memory, but I'm pretty sure that was the coolest piece of software ever written anywhere at any time.

Re: Ooops.

#174
post #46

I learned a rather unusual trick to keep myself safe from unintended glob matches. It is not "fool"-proof, but it will probably dilute an unmitigated disaster into an incomplete disaster: Keep a file named -i in the sensitive directories. When glob picks it up, which should be fairly early, it will be treated like a command line argument. Has saved me on occasions. I also had a friend in school who used to, for whate…

Just make sure no one is sadistic enough to follow you around running touch -- --

I've run a TRUNCATE in production by accident thinking I was logged into the dev system. I truncated the 4 core user / transaction tables. I've never felt the blood drain from my body so quickly.

Good old binary logs and an office floor to sleep on. I make copies of the data whenever deleting or truncating now. I think we all have to do something ridiculously stupid to start taking precautions.

Re: Ooops.

#175
post #46

I learned a rather unusual trick to keep myself safe from unintended glob matches. It is not "fool"-proof, but it will probably dilute an unmitigated disaster into an incomplete disaster: Keep a file named -i in the sensitive directories. When glob picks it up, which should be fairly early, it will be treated like a command line argument. Has saved me on occasions. I also had a friend in school who used to, for whate…

If you are on a Mac, you must know that you should never put the `-i` option at the end:

  $ ls | wc -l
         5
  $ rm * -i
  rm: -i: No such file or directory
  $ ls | wc -l
         0

Re: Ooops.

#176

Earlier quoted context omitted.

The -I flag is a bit more friendly; one may safely alias rm to rm -I and not even notice on the common case (deleting a single file).

I use a script that moves a file to a ~/.trash directory when I use rm. If I am sure I want to actually delete a file permanently I just use /bin/rm.

But that's also the best way to becoming careless about typing "rm".

And the day you will be ssh'd on another computer, you may forget that you are using a command which is really deleting.

Re: Ooops.

#178
post #65

The reason we all know to be careful with rm -r is because of that one time we weren't. Me, it was the time I rm r'ed the MySQL data directory for my company's customer service management system. Oops. Thankfully we had a backup from the month prior, but I learned two things that day: a) be really careful with rm and b) take it on yourself to make sure IT is backing up stuff that you're messing with. You gotta hedge…

Was asked to uninstall IBM/Rational ClearCase from our source code repository server. Apparently at the time, Clearcase's installer NFS mounted 127.0.0.1:/ to a subdirectory. Don't ask me what brain-dead system designer thought this was a good idea. So, I did a simple /etc/init.d/clearcase stop (not sure that is the exact name) and: # rm -rf /opt/clearcase (hmm... that seems to be taking a little too long to run) Pan…

One of my first tasks after being given root access at my first n?x job at an ISP was "clear off all of the DNS stuff on $main_server since we have $dedicated_dns_server now".

So I merrily started mv-ing things to a scratch directory that we could wipe in 6 months if we didn't need anything from it.

Unfortunately, the zone file directory was NFS mounted from* $dedicated_dns_server. With pass root set.

I think I took all of A through to K of client zones offline before we noticed.

I'm just very very glad I decided to do it as an mv rather than an rm, since it meant all I needed to do was copy things back.

Not that I really learned my lesson that time; it took a couple more semi-disasters before I got sufficiently paranoid to be reasonably safe as root.

Re: Ooops.

#179

Earlier quoted context omitted.

It's like reading Youtube comments--not for the faint of heart. And the jab at reddit from the HN pedestal is probably misguided... reddit used to be more like HN, and HN is becoming more like the bad parts of reddit every day. Every site tends toward Youtube level comments as time passes, and the people who don't like it eventually jump ship to a new site, and then the process repeats itself.

"And the jab at reddit from the HN pedestal is probably misguided... reddit used to be more like HN, and HN is becoming more like the bad parts of reddit every day." But you just did the same thing...

There's nothing more irresistible to a tech geek than recursive irony, regardless of where they fall (or wish they fell) on the YouTube/Digg/Reddit/HN commenter spectrum.

Re: Ooops.

#180
post #163

I've done a similar thing a few years ago when I was first starting work on my guild hosting company's code. At the time, the main thing hosted on that machine was my WoW guild's website, which I had been working on for close to a year, and was beginning work on converting the site over to a general purpose guild hosting site. I was doing some work for a client, setting up a mirror of sorts for some kind of yearbook…

Yeah, the same thing happened to me a couple of years ago and at the time I thought I was the coolest guy on the planet when I recovered most of my data. I had accidentally deleted all my chat logs. Luckily, all the chat logs had a timestamp in them, so I just searched for all timestamped lines on the disk and dumped them to a file. I then wrote a script to group and sort all the logs based on the date and who I was talking to and recreate all the files. It worked better than it had any right to especially since I was doing everything on a live disk!
Post reply on HN