In what could be the ultimate example of having "one of those days," a man has managed to delete his entire company by mistakenly running a single piece of code.

Update: And, of course, it was a hoax.

As reported by The Independent, Marco Marsala, who runs (or perhaps that should now be 'ran') a small web hosting company, inadvertently ran the 'rm -rf' command line while performing maintenance operations on his servers.

For those who don't know, 'rm' tells the computer to remove, and the '-rf' part deletes everything by force, overriding the usual safety warnings.

The command line is often used to delete from a specific directory, but none was given because it was ran by accident.

Marsala used a Bash script that was supposed to set the location, but a bug in the code above the line in question meant no directory was given, resulting in absolutely everything being deleted.

Writing on the Server Fault forum, Marsala said: "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."

Marsala went on to explain that the line of code had also deleted his backups and all his customers' websites. "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)."

Forum users told Marsala that his only option was to now contact a data recovery service, hope for the best, and get a good lawyer. He was also criticized for not putting safeguards in place that would have stopped this particular line of code from running without a specified location.

"This is not bad luck: it's astonishingly bad design reinforced by complete carelessness," wrote forum user Massimo.

Image credit : kikovic / shutterstock