This one line of code just destroyed a whole company

Written by Rehan Ahmed ·  1 min read >

A small hosting provider with 1,500+ customers was just accidentally destroyed by its owner with just one line of code.

Marco Marsala runs a web hosting company that looks after the servers and internet connections on which the files for websites are stored. He was just having a normal work day and after encountering a bug in his code, he executed a simple one-line command but instead of fixing the bug, the command ended up deleting his whole company.

How can a line of code delete a company? Well, the code Marsala ran was “rm -rf”, a simple command that can delete everything it is told to. Basically, the “rm” tells the computer to remove, the r deletes everything within a given directory and the f stands for “force”, instructing the computer to ignore the usual warnings that come when deleting files. It is normally used to only delete specific parts of the computer but due to a horrendous yet minor error, the code ended up deleting everything on Marsala’s computer, essentially removing all the data of the servers his company looked after.

“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.” wrote Marsala on a forum.

To make it even worse, the command also deleted all of his offsite backups because the remote storage was mounted just before by a backup maintenance script. As a result, every piece of data essential to his company’s existence is gone and as of now, it is nearly impossible for it to recover. As one commenter said, “I feel sorry to say that your company is now essentially dead”.

Backing-up important data is an essential piece of advice given by most technical experts but this incident shows that how sometimes, even having one backup isn’t enough.

UPDATE: In a shocking move, Marsala, the person who claimed to have deleted his whole company through the code mistake, has now revealed that the whole ordeal was simply a hoax. In fact, it was more of a marketing stunt to promote his own company, Ansible, that actually prevents such large scale mistakes, and that the situation he described “can not happen” with that tool.

Source- Independent

Written by Rehan Ahmed
I cover startups, review gadgets and talk about latest developments in the technology industry. Get in touch through Profile