{"id":207004,"date":"2016-04-15T13:01:11","date_gmt":"2016-04-15T13:01:11","guid":{"rendered":"http:\/\/4cd.e16.myftpupload.com\/?p=207004"},"modified":"2016-04-15T13:01:11","modified_gmt":"2016-04-15T13:01:11","slug":"man-accidentally-deletes-entire-company-with-one-line-of-bad-code","status":"publish","type":"post","link":"https:\/\/citifmonline.com\/?p=207004","title":{"rendered":"Man accidentally &#8216;deletes entire company&#8217; with one line of bad code"},"content":{"rendered":"<p class=\"p1\"><span class=\"s1\">A man appears to have deleted his entire company with one mistaken piece of code.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala<\/span><span class=\"s2\">\u00a0has seemingly\u00a0<\/span><span class=\"s1\">removed all trace of his company and the websites that he looks after for his customers<\/span><span class=\"s1\">.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Mr Marsala wrote on a forum for server experts <strong><span style=\"color: #666699;\"><a style=\"color: #666699;\" href=\"http:\/\/serverfault.com\/questions\/769357\/recovering-from-a-rm-rf\">called Server Fault<\/a><\/span><\/strong>\u00a0that he was now stuck after having accidentally run destructive code on his own computers. But far from advising them how to fix it, most experts informed him that he had just accidentally deleted the data of his company and its clients, and in so doing had probably destroyed his entire company with just one line of code.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">The problem command was &#8220;rm -rf&#8221;: a basic piece of code that will delete everything it is told to. The \u201crm\u201d tells the computer to remove; the r deletes everything within a given directory; and the f stands for \u201cforce\u201d, telling the computer to ignore the usual warnings that come when deleting files.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Together, the code deleted everything on the computer, including Mr Masarla\u2019s customers&#8217; websites, he wrote. Mr Masarla runs a web hosting company, which looks after the servers and internet connections on which the files for websites are stored.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">That piece of code is so famously destructive that it has become a joke within some computing circles.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Normally, that code would wipe out all of the specific parts of the computer that it was pointed at. But because of an error in the way it was written, the code didn\u2019t actually specify anywhere \u2013 and so removed everything on the computer.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cI 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,\u201d wrote Marco Marsala. \u201cLast 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.\u201d<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Mr Marsala confirmed that the code had even deleted all of the backups that he had taken in case of catastrophe. Because the drives that were backing up the computers were mounted to it, the computer managed to wipe all of those, too.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cAll 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).\u201d<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Most users agreed that it was unlikely that Mr Marsala would be able to recover any of the data. And as a result his company was almost certainly not going to recover, either.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cI feel sorry to say that your company is now essentially dead,\u201d wrote a user called Sven. \u201cYou 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.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cThis will be extremely expensive and still extremely unlikely to really rescue you, and it will take a lot of time.\u201d<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Others agreed that perhaps Mr Marsala was on the wrong forum.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cYou&#8217;re going out of business,\u201d wrote Michael Hampton. \u201cYou don&#8217;t need technical advice, you need to call your lawyer.\u201d<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">Many of the responses to Mr Marsala\u2019s problem weren\u2019t especially helpful \u2013 pointing out that he could have taken steps to stop it happening before it did.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cWell, you should have been thinking about how to protect your customers&#8217; data before nuking them,\u201d wrote one person calling himself Massimo. \u201cI won&#8217;t even begin enumerating how many errors are simultaneously required in order to be able to completely erase all your servers and all your backups in a single strike.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">\u201cThis is not bad luck: it&#8217;s astonishingly bad design reinforced by complete carelessness.\u201d<\/span><\/p>\n<div class=\"dnd-widget-wrapper context-sdl_editor_representation type-video\"><\/div>\n<p class=\"p1\"><span class=\"s1\">Mr Marsala\u2019s problem is far from the first time that someone has accidentally destroyed their own system by missing a mistake. Indeed, responses to his post mostly referenced a similar thread posted two years ago, with the headline \u201cMonday morning mistake\u201d.<\/span><\/p>\n<p class=\"p1\"><span class=\"s1\">That error saw someone accidentally lose access to their entire server, after they didn\u2019t notice a stray space in the code.<\/span><\/p>\n<p class=\"p1\">&#8211;<\/p>\n<p class=\"p1\">Source: The Independent<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A man appears to have deleted his entire company with one mistaken piece of code. By accidentally telling his computer to delete everything in his servers, hosting provider Marco Marsala\u00a0has seemingly\u00a0removed all trace of his company and the websites that he looks after for his customers. Mr Marsala wrote on a forum for server experts [&hellip;]<\/p>\n","protected":false},"author":14,"featured_media":207009,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jnews-multi-image_gallery":[],"jnews_single_post":[],"jnews_primary_category":[],"jnews_social_meta":[],"jnews_override_counter":[],"footnotes":""},"categories":[117,106],"tags":[],"class_list":["post-207004","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-odd","category-technology"],"_links":{"self":[{"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/wp\/v2\/posts\/207004","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/wp\/v2\/users\/14"}],"replies":[{"embeddable":true,"href":"https:\/\/citifmonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=207004"}],"version-history":[{"count":0,"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/wp\/v2\/posts\/207004\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/citifmonline.com\/index.php?rest_route=\/"}],"wp:attachment":[{"href":"https:\/\/citifmonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=207004"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/citifmonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=207004"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/citifmonline.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=207004"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}