Slashdot Mirror


Man Deletes His Entire Company With One Line of Bad Code (independent.co.uk)

Reader JustAnotherOldGuy writes: Marco Marsala appears to have deleted his entire company with one mistaken piece of code. By accidentally telling his computer to delete everything in his servers, the hosting provider has seemingly removed all trace of his company and the websites that he looks after for his customers. Marsala wrote on a Centos help forum, "I run a small hosting provider with more or less 1535 customers and I use Ansible to automate some operations to be run on all servers. Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar} with those variables undefined due to a bug in the code above this line. All servers got deleted and the offsite backups too because the remote storage was mounted just before by the same script (that is a backup maintenance script)." The terse "rm -rf" is so famously destructive that it has become a joke within some computing circles, but not to this guy. Can this example finally serve as a textbook example of why you need to make offsite backups that are physically removed from the systems you're archiving?"Rm -rf" would mark the block as empty, and if the programmer hasn't written anything new, he should be able to recover nearly all of the data. Something about the story feels weird.

5 of 460 comments (clear)

  1. Empathy by The-Ixian · · Score: 4, Funny

    I have that cold feeling in my stomach just reading this summary. ick.

    I did something similar (though not quite so destructive) nearly 20 years ago when I was first learning Linux.

    I my case I was trying to get rid of all the hidden files in root's (/root) home dir using 'rm -rf .*'

    Guess what that did?

    Yeah, that wasn't a highlight of my career...

    --
    My eyes reflect the stars and a smile lights up my face.
  2. Re:He should have been using SystemD. by Anonymous Coward · · Score: 0, Funny

    Spell it SystemD not systemd.

    That way it looks like an ASCII penis.

  3. Re:manishs by msmash · · Score: 3, Funny

    I hope you're not being sarcastic.

  4. Re:Three words by flopsquad · · Score: 5, Funny

    Offsite, offline BACKUPS

    Would not have helped in this situation. His typo resulted in this command:

    "rm -rf --no-preserve-root --write-zeroes --shred-mbr --exec-all-ssh-hosts --douse-hydrofluoric --high-velocity-eject-removable-media --carpet-bomb-offsite-backup --salt-earth"

    Which, I mean, who hasn't accidentally done that? The keys are like right next to each other.

    --
    Nothing posted to /. has ever been legal advice, including this.
  5. Re:Three words by billyoc903 · · Score: 5, Funny

    I have this aliased to 'sl'. Keeps me on my toes.