Your forum username:
Do you already have an account?
Forgot your password?
  • Log in or Sign up

    Welcome to Sky User - The Unofficial Support Forum for everything Sky! - Proudly helping over 65k members.


    Results 1 to 4 of 4

    This unlucky man accidentally 'deleted his entire company' with one line of code

    This is a discussion on This unlucky man accidentally 'deleted his entire company' with one line of code within the General Computing and Internet forums, part of the Community channel category; A man accidentally 'deleted his entire company' with one line of code | Tech | Life & Style | Daily ...

    1. #1
      Scubbie's Avatar
      Scubbie is offline Sky User Moderator
      Exchange: 02392
      Broadband ISP: Other ISP
      Router: Non-Sky Router
      Sky TV: Sky+HD box
      Join Date
      Mar 2010
      Near Portsmouth
      Thanked 2,240 Times in 2,103 Posts

      This unlucky man accidentally 'deleted his entire company' with one line of code

      A man accidentally 'deleted his entire company' with one line of code | Tech | Life & Style | Daily Express
      THINK you've had a bad day at the office? Have you ever deleted your entire company from existence with one bad line of code?

      Marco Marsala has accidentally deleted his entire company with one bad piece of code.

      The hosting provider mistakenly told his computer to delete everything in his servers – including the back-ups – removing any trace of his company, as well as the websites he manages for his customers.

      Mr Marsala posted his tragic tale on a forum for server experts, dubbed Server Fault.

      But instead of coming up with a solution to his problem, the online experts informed Mr Marsala that he had destroyed his entire company with one line of code.

      The problems stems from the command "rm -rf" – a simple piece of code that will delete anything it is pointed towards.

      The "rm" tells the computer to remove, the following "r" is a command to delete everything within a given directory, and the final "f" stands for "force" – which tells the computer to ignore any warnings that might be flagged up when deleting the items in the directory.

      By stringing all four letters together, Mr Masarla managed to delete everything on the computer, including his customers' websites, he posted on Server Fault.

      “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,” he wrote.

      “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.”

      Because of the way the code was written, the destructive string didn’t actually specify a given directory on the computer – so proceeded to remove everything, including all of the mounted back-up drives.

      “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)," he added.

      The majority of users agreed it was unlikely Mr Marsala would ever be able to recover his data.

      As a result, it is extremely unlikely his company will be able to survive this disaster.

      "You're going out of business," wrote one Server Fault user, named Michael Hampton.

      "You don't need technical advice, you need to call your lawyer."

      Another, dubbed Sven, said: “I feel sorry to say that your company is now essentially dead.

      "You might have an extremely slim chance to recover from this if you turn off everything right now and hand your disks over to a reputable data recovery company.

      "This will be extremely expensive and still extremely unlikely to really rescue you, and it will take a lot of time."

      Meanwhile some Server Fault users were less sympathetic than others.

      One user, known only as Massimo, posted: "Well, you should have been thinking about how to protect your customers' data before nuking them.

      "I won't even begin enumerating how many errors are simultaneously required in order to be able to completely erase all your servers and all your backups in a single strike.

      "This is not bad luck: it's astonishingly bad design reinforced by complete carelessness."

    2. Advertisement
    3. #2
      seawright's Avatar
      seawright is offline Sky User Member
      Exchange: 02392
      Broadband ISP: Other ISP
      Router: Non Sky Router
      Sky TV: Sky+HD box
      Join Date
      Jul 2012
      Thanked 389 Times in 379 Posts

      Re: This unlucky man accidentally 'deleted his entire company' with one line of code

      This is nothing new. The command has been around since the first UNIX style operating system was written.
      The really destructive command is "rm -rf /" which forces a recursive removal of the root directory "/" and all files and directories below it. In effect all the storage on the computer and any mounted remote storage that has write access.

      Apart from being very careful how can you guard against it?

      • Mission critical data should have an off site (and preferably off-line) backup.
      • Scripts should be developed and tested in a sandbox environment.
      • Even if your role is that of system administrator, log in as a normal user and only assume super user status where the task requires it. That way even if you do issue a destructive command by mistake the damage you can do will be limited by a users access permissions.

    4. #3
      speedyrite's Avatar
      speedyrite is offline Sky User Member
      Exchange: MYHGT
      Broadband ISP: NOW Fab Fibre (Sky network)
      Router: NOW TV Hub Two
      Sky TV: NowTV
      Join Date
      Sep 2006
      Thanked 167 Times in 161 Posts
      Blog Entries

      Re: This unlucky man accidentally 'deleted his entire company' with one line of code

      I'm guessing he won't make that mistake ever again! "You're fired!"

      To be honest, I'm not surprised that it has happened - I'm more surprised that it doesn't happen more often. Over my many years of working in IT on "big blue iron", it never ceased to amaze me how many companies technically allowed people working on "newer technology" server based systems to automatically have the power to execute such commands without any prior planning, management approval or authorisation, usually as a result of having slack or "less mature/robust" processes in place to secure against events like this happening.

      Likewise, a DBA should never be able to execute commands to modify (add/change/delete) data in a production (live) system without a lot of planning and testing (on a test database) having happened beforehand to ensure that armageddon does not accidentally occur!
      ++ speedyrite ... powered by NOW Broadband from June 2018 ++
      (previously powered by Sky Broadband from July 2007)

    5. #4
      The Realist's Avatar
      The Realist is offline Sky User Member
      Exchange: Anything
      Broadband ISP: Sky Fibre 100GB Trial Gold X
      Router: Sky Q Hub Mk7 Trial Gold
      Sky TV: SkyQ/Motorised
      Join Date
      Mar 2007
      Behind You
      Thanked 29 Times in 29 Posts

      Re: This unlucky man accidentally 'deleted his entire company' with one line of code

      He should of read the code before running the command and running rf and f from a command prompt is madness.

      Sorry to be blunt but he should of had off site backups running that would of saved his **** and company.
      Disclaimer: The views expressed here are my own and in no way represent the views or policies of my employer.



    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    SkyUser - Copyright © 2006-2020. SatDish and NewsreadeR | SkyUser is in no way affiliated with Sky Broadband / BSkyB