Bad day at the office? This man accidentally deleted his entire business using a line of bad code

Update: Turns out it was all a hoax. Stack Overflow, which runs Server Fault, claims that the post by Marco Marsala was just an elaborate "marketing effort" to promote his company. It said in a statement: "The moderators on Server Fault have been in contact with the author about this, and as you can imagine, they're not particularly amused by it."

Spare a thought for the guy who managed to erase his entire company with a single line of dodgy code. Marco Marsala, who runs a small web hosting company, found himself in somewhat of a dire situation after accidentally instructing his computer to "nuke" both his and his customers' data.

The Independent reports the problem arose when Marsala ran the highly volatile "rm -rf" command, which essentially tells a computer to ignore all warnings and delete everything in its wake. Because Marsala forgot to specify which part of the computer it was directed at, the command erased absolutely everything – including the websites he looked after for his clients and the off-site backups, which were connected to the computer at the time.

After realising his mistake, Marsala took to Server Fault, a forum set up for server experts. "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," 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."

Call a lawyer

"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). How I can recover from a rm -rf / now in a timely manner?"

The feedback wasn't promising. "If you really don't have any backups I am sorry to say but you just nuked your entire company," wrote one expert. Others lambasted Marsala for not taking the proper precautions to protect his customers' data, while one user offered a particularly sobering response: "You're going out of business. You don't need technical advice, you need to call your lawyer."

Next time you think you're having a bad day, just be glad you're not this guy.