Jump to Main ContentJump to Primary Navigation
Top

Man types the wrong piece of code & accidentally deletes entire company

sadcomputerman.jpg

We've all done it.

Leaned back after finishing a long essay and promptly kicked out the power lead. Gone to hit the save button and accidentally slid across to hit the x button. Clicked 'no' when we meant 'yes'. Now we think of it, we've probably lost half the work we've ever done over the years.

But at least we never did this.

One unlucky programmer has managed to delete his entire hosting company after mistakenly inputting one piece of code.

Hosting provider Marco Marsala went on to a forum for server experts, Server Fault, to request help for his service - and their responses were not pretty reading.

He used the code "rm -rf". The "rm" instructs the computer to remove, the "r" deletes everything in a given directory and "f" instructs the machine to use force - ie. to ignore any warnings that usually come before the computer deletes anything. In a normal situation, this code would just wipe specific parts of a computer, but because of a bug in the code above the line, it simply deleted everything it could find, including Mr Masarla's customers' websites, as well as all of his backups, due to his recovery drives being mounted to the computer.

Whoops.

He explained, “I run a small hosting provider with more or less 1,535 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).”

A forum user named Sven broke the bad news.

“I feel sorry to say that your company is now essentially dead,” he wrote, while another comforted him with the words, "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."

Just keep hitting 'Undo' and hope for the best. That's our advice.

(Image: Shutterstock)

[via Independent]

Related

hal.jpg

We put Microsoft's new photo caption AI bot to the test

cig.jpg

Someone managed to get Flappy Bird working on an e-cig

notting-hill.jpg

These are the best areas in London to use a dating app

hover.jpg

Someone finally made a working hoverboard

iphonehack.jpg

Here's how the FBI hacked the San Bernardino iPhone

htc4.jpg

The HTC 10 could be your favourite Android phone

More

The biggest stereotype about men and sex is actually a load of rubbish

We've been wrong this whole time

by Gary Ogden
18 Aug 2017

Discover the words that became cool in the year you were born

Were you born in the year of booty calls or cybersex?

by Emily Reynolds
18 Aug 2017

This German town came up with a genius way of humiliating neo-Nazis

Is this the best possible way to deal with them?

by Alex Finnis
18 Aug 2017

Donald Trump’s lawyer: possibly not racist, definitely not intelligent

Oldest trick in the book

by Tom Victor
17 Aug 2017

We have some very, very good news about cheese

Cheese lovers, it's our time to shine

by Emily Reynolds
17 Aug 2017

Jurors refuse to work on Martin Shkreli's trial for the best reasons

He is *not* a popular man

by Emily Reynolds
17 Aug 2017

Apparently millennials hate boobs now - but what do we like instead?

These god damn millennials, eh

by Gary Ogden
17 Aug 2017

All the times Donald Trump has failed to condemn far-right extremists

This has gone on for some time

by Tom Victor
16 Aug 2017

Flight attendants share the 25 worst things passengers do

How many of them are you guilty of?

by Gary Ogden
16 Aug 2017

Obama's response to Charlottesville is now the most-liked tweet ever

Puts Trump's response to shame

by Emily Reynolds
16 Aug 2017