Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Man accidentally 'deletes his entire company' with one line of bad code
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Man accidentally 'deletes his entire company' with one line of bad code

MarkTurnerMarkTurner Member
edited April 2016 in General

http://www.independent.co.uk/life-style/gadgets-and-tech/news/man-accidentally-deletes-his-entire-company-with-one-line-of-bad-code-a6984256.html

Mr Masarla runs a web hosting company,

Last night I accidentally ran, on all servers, a Bash script with a rm -rf {foo}/{bar}

Thanked by 1netomx
«13

Comments

  • is this suppose to be a joke ? cause i didn't laugh at it.

  • Ok, I managed to clone and empty repo into my working directory. Long day, tired eyes and 'terminal' a good mix they do not make.

    Not as bad as the OP story but I will bet many on here have committed similar 'Oh f#@k' mistakes.

    Thanked by 1FalconsCloud
  • That's why backup is essential.

  • SSDBlazeSSDBlaze Member, Host Rep

    The man claimed to have backups on other mounted drives on the server but the command wiped his backups on the mounted drives

    I don't think he had any offsite backups then.

    Thanked by 3GCat PremiumN HBAndrei
  • PandyPandy Member

    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).

    yea, well rip that company :P

    saw it on r/sysadmin (i swear it was there? cant check history as on dif comp) and jarland linked it on Cest Pit earlier

  • @Pandy said:
    saw it on r/sysadmin (i swear it was there? cant check history as on dif comp) and jarland linked it on Cest Pit earlier

    Yeah thats where I saw it first, and he then "supposedly" done a DD in the wrong direction. Not sure if to fully believe or not.

  • PandyPandy Member

    @AshleyUk said:
    Yeah thats where I saw it first, and he then "supposedly" done a DD in the wrong direction. Not sure if to fully believe or not.

    Yea i remember that.

    some ppl thought about it being a troll, that it shouldnt have done it without --preserve-root (Or whatever the extra thing is, im no guru on that stuff) but i guess that dephens on the distro it was running on

  • edited April 2016

    I can't even imagine what the guy must be going through.

    One thing I will never understand is why people keep backups mounted or connected all the time.

  • ValdVald Member

    i hate how many people defend linux and act so ignorant.
    You should not be able to delete core system files just by typing rm -rf /
    It happened to me long time ago and i know many would suggest dont login as a root bla bla bla, but its just wrong. Root or not at least there should be a warning that you are about to delete the whole fucking system.

    Thanked by 2zafouhar stormeye
  • Ansible... f*ck up at scale :)

    Anything rm -r related, if at all possible non-root... and certainly avoid variables if possible. I tend to stare at the screen for 10 seconds, check my sanity, palpitate for a little and then enter the command.

  • jarjar Patron Provider, Top Host, Veteran
    edited April 2016

    @Vald said:
    i hate how many people defend linux and act so ignorant.
    You should not be able to delete core system files just by typing rm -rf /
    It happened to me long time ago and i know many would suggest dont login as a root bla bla bla, but its just wrong. Root or not at least there should be a warning that you are about to delete the whole fucking system.

    There are operating systems for people who need hand holding, and those operating systems are generally not designed for pretending to run a hosting company.

    Show me a Linux server distro that doesn't give me the ability to make destructive mistakes, as defined by a third party, and I'll show you the trash can it belongs in.

  • PandyPandy Member

    @Vald said:
    i hate how many people defend linux and act so ignorant.
    You should not be able to delete core system files just by typing rm -rf /
    It happened to me long time ago and i know many would suggest dont login as a root bla bla bla, but its just wrong. Root or not at least there should be a warning that you are about to delete the whole fucking system.

    Why were you entering rm -rf /?
    you should atleast know what you are typing, and to google it if you dont.

    i dont see new user randomly just typing that command on terminal with root tho ;)

  • MadMad Member

    I'm just curious to know what's his company :)

    Thanked by 1zafouhar
  • rm -rf is a common command in day to day sysadmin - it just takes a slip of the hand, or a brainfart to do rm -rf /

    I nuked a partition on a newly installed solaris server ~15 years ago by doing this, so luckily it just cost me time. In truth I shouldn't have been allowed next to near the machine as I had literally no idea what I was doing beyond CS 101 UNIX. I also "configured" a very expensive HP-UX server and got started on an AS/400 before my frugal boss realised the error of his ways and hired a real sysadmin,

    Thanked by 2ricardo Vald
  • Yeah, regardless of experience... everyone requires the intellectual honesty to appreciate that human error happens, a lot. Best we can do is by-design do things [already probably mentioned in relation to this example]

    Thanked by 1Vald
  • ValdVald Member
    edited April 2016

    jarland said: There are operating systems for people who need hand holding, and those operating systems are generally not designed for pretending to run a hosting company.

    Show me a Linux server distro that doesn't give me the ability to make destructive mistakes, as defined by a third party, and I'll show you the trash can it belongs in.

    Linux is not only for those that are running a hosting company, i just use it for development.
    If you are saying that it should be made as hard as possible so only a handful of people are allowed to use then i dont see any point here.

    Maybe they should manufacture guns that shoot backwards by turning the safety switch on the other side as well, so that we can have the option to self destruct by mistake.

    Thanked by 2kzed stormeye
  • ValdVald Member
    edited April 2016

    @Pandy said:

    I was in the directory that i wanted to delete the files from, considering how other commands work i was expecting the same effect and passed in a / which was wrong, but that does not justify a whole system deletion, no matter how hard you defend it.

    In fact if they say ok this can be better and we could implement some sort of safety trigger, then guys like you will defend that decision as well, because.. hey.. that's what have been decided.

  • Is it just me or does this sound completely made up and a "shits and giggles" question someone posted on SE?

    Thanked by 3deadbeef Ole_Juul Pwner
  • @Vald said:
    Linux is not only for those that are running a hosting company, i just use it for development. If you are saying that it should be made as hard as possible so only a handful of people are allowed to use then i dont see any point here.

    That's the point. People who don't see the point need to point their bootloader to Windows or OSX. Linux is not "retarded-proof". And I object to your estimation that only "a handful of people" are not retards. That said, you can't rm -rf / without a flag in modern distros.

    Just because one has a pulse, doesn't mean one is certified to access the root account on his machine.

  • HBAndreiHBAndrei Member, Top Host, Host Rep

    @Jonchun said:
    Is it just me or does this sound completely made up and a "shits and giggles" question someone posted on SE?

    It's not just you, probably a lot of folks, including myself, find this too unreal to be true... but honestly I wouldn't be extremely surprised if it were real either.

  • @Vald said:
    but that does not justify a whole system deletion, no matter how hard you defend it.

    There's nothing to defend. The computer assumes you actually know wtf you ask it to do and happily obliges. You wouldn't want the computer to think it's smarter than its user, right? No need for them rising up.

    Thanked by 2jar ATHK
  • Jonchun said: Is it just me or does this sound completely made up

    I think so too. It's bullshit.

  • jarjar Patron Provider, Top Host, Veteran
    edited April 2016

    squibs said: it just takes a slip of the hand, or a brainfart to do rm -rf /

    Umm no it doesn't. You're passing two flags to the rm command and a path. Two flags and a path from just accidentally dropping your phone on the keyboard? I think not. More likely "Trusted an internet troll and got burned."

    Vald said: If you are saying that it should be made as hard as possible so only a handful of people are allowed to use then i dont see any point here.

    I'm saying that I need my Linux to be for admins, not for kids. Make a distro for kids, but don't tell me it needs to be running on my server. If you need a server distro that doesn't let you run commands just because they can be destructive if accidental, as declared by a random third party (it's developer, not me...the admin), then I can't for the life of me understand what you're doing. Whatever it is, it isn't server administration. The distro developer does not know what my needs are, and I may need access to things that can be destructive if run by "accident" with multiple flags and a path.

    You need to be able to run things without confirmation for scripting. No matter how complex those commands are made to avoid "accidents" some troll will still tell you to run the command on an internet forum and you'll still do it, resulting in the same problem. Changing the command every time it propagates across the internet and is used to troll someone is not a reasonable request for something used for production.

    There are development environments that are not root accounts to Linux server distros. If development is what you need, and you're prone to "accidentally" passing two destructive flags and a path to the rm command, you really should be looking at one of those other products. Asking you to not use something you are not adequately prepared to use is much more reasonable than asking the world at large to change it's reliance on basic Linux functions every time someone on reddit says "lol run rm -rf /" and you do it.

    Vald said: Maybe they should manufacture guns that shoot backwards by turning the safety switch on the other side as well, so that we can have the option to self destruct by mistake.

    If someone wants to make a backwards gun that's fine. But don't go buying it and complaining that it fires backwards. Obviously, whoever that was made for needs a gun that fires backwards and you bought the wrong product.

  • ValdVald Member

    deadbeef said: There's nothing to defend. The computer assumes you actually know wtf you ask it to do and happily obliges. You wouldn't want the computer to think it's smarter than its user, right? No need for them rising up.

    just stop man, you are full of non sense, you are deleting the system and there should be a safety trigger

    tell me one drawback of having it and i will justify your ridiculous oppinion

  • jarjar Patron Provider, Top Host, Veteran
    edited April 2016

    Vald said: there should be a safety trigger

    There is! You used a flag that was designed to override it! You don't just accidentally fall into "rm -rf /" you ran it because someone told you to and you trusted them, when you clearly should not have.

    Vald said: tell me one drawback of having it and i will justify your ridiculous oppinion

    Scripting without hackish workarounds.

    Thanked by 1ricardo
  • ValdVald Member

    jarland said: If someone wants to make a backwards gun that's fine. But don't go buying it and complaining that it fires backwards. Obviously, whoever that was made for needs a gun that fires backwards and you bought the wrong product.

    which proves my point, it should not allow you to shoot your self in the foot/head. Very simple and logical.

  • jarjar Patron Provider, Top Host, Veteran

    Vald said: it should not allow you to shoot your self in the foot/head

    Damn I got trolled lol. I thought you were serious.

  • k0nslk0nsl Member

    On the other hand, what a good excuse to bail-out, if there ever was one...no?

    Thanked by 1jar
  • @Vald said:
    just stop man, you are full of non sense, you are deleting the system and there should be a safety trigger

    Just because you don't have the hardware capability to understand a notion, does not equate said notion to nonsense. That said, I understand that it is nonsensical to you specifically.

    tell me one drawback of having it

    One? I'll give you more:

    • Having it would make actually competent people bothered
    • Having it would keep low IQ people on the OS, thereby increasing the retartedness-proof "demand"
    • Having it would decrease the coolness factor of "f*ck you, go back to Windows you ignorant subhumanoid dork"

    and i will justify your ridiculous oppinion

    You are in no position to justify anything, you know that right?

    Thanked by 2jar Ole_Juul
  • ValdVald Member

    k0nsl said: On the other hand, what a good excuse to bail-out, if there ever was one...no?

    bail out? im just happy to bail out from ignorant minds atm.

    jarland said: You need to be able to run things without confirmation for scripting.

    yeah i bet everyone needs a rm rf on the whole system once in a while

Sign In or Register to comment.