Marco Marsala learns how not to code the hard way.
By Sreekanth A. Nair
A UK based businessman, Marco Marsala, wouldn’t have thought of destructing his company when he entered a code on his computer server. But the wrong code has literally destructed his company as he lost all websites that the company hosted, reported the Independent.
Marsala ran a web hosting company that stored the files of over 1535 websites. A wrong code that he accidentally typed on the server computer has deleted all the data including that of his client websites.
The bizarre incident came to light when Marsala wrote about the incident on a forum for server experts ‘Server Fault’ on Thursday.
“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. 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 wrote.
As he back up servers was also mounted to the computer, the code deleted all the backup files too.
“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.
Most of the experts on the forum said that all the data on his computer would have lost and it is less likely that Marsala can recover it.
“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 recover the company,” wrote a user called Sven.
The code, if entered, will delete everything it is directed. The “rm” tells the computer to remove; the “r” deletes everything in the given directory and the “f”stands for “force” that avoids the usual warning given before deleting files.
Usually, the code deletes everything within the given directory. But, it deleted everything on the server as Marsala failed to specify the directory.