{"id":2569,"date":"2011-12-06T04:50:02","date_gmt":"2011-12-05T20:50:02","guid":{"rendered":"http:\/\/hazelong.com\/?p=2569"},"modified":"2011-12-06T04:50:02","modified_gmt":"2011-12-05T20:50:02","slug":"restoring-deleted-files-ftp-cpanel","status":"publish","type":"post","link":"https:\/\/musenmaker.com\/hazelong\/?p=2569","title":{"rendered":"Restoring Deleted Files in FTP via Cpanel"},"content":{"rendered":"<p>Here I am at 2 am and there is an emergency email from a client. Went to the Mac and meddle with some files, trying to right some wrong. Feeling like a boss, I started deleting all the redundant files and fucking hell, I deleted the entire album of photos. From 2007 til 2011. All the photos gone.<\/p>\n<p>I started sweating. Images of cigarettes appear in my head. I sat there stoned. Ok calm down. Solutions solutions.<\/p>\n<h2>Option 1\/\/ .trash Folder<\/h2>\n<p>I navigated to each folder and start looking for the deleted folders. Especially in the Trash can. Nothing there. \/.trash folder is empty too. FML<\/p>\n<h2>Option 2\/\/ SSH<\/h2>\n<p>Ok ok. fine fine. I&#8217;ll just log in to the cPanel and give myself a SSH access. No login credentials were given for either. After trying a few times, holy moly I am in the cPanel. Fuck yea meme &#8211; I feel like a hacker. No time to gloat, SSH settings here we go.<\/p>\n<p>Generate public keys.. private keys. I have done this before. but the instructions are swimming in front of me cuz I am too fucking stressed. Great. And what&#8217;s that search function for Terminal again. I can&#8217;t remember. Damn.<\/p>\n<p><a href=\"http:\/\/hazelong.com\/wp-content\/uploads\/2011\/12\/Screen-Shot-2011-12-06-at-4.14.12-AM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2570\" title=\"Screen Shot 2011-12-06 at 4.14.12 AM\" src=\"http:\/\/hazelong.com\/wp-content\/uploads\/2011\/12\/Screen-Shot-2011-12-06-at-4.14.12-AM-500x227.png\" alt=\"\" width=\"500\" height=\"227\" \/><\/a><\/p>\n<h2>Option 3\/\/Backups in cPanel<\/h2>\n<p>Not likely to work. Since it wasn&#8217;t set up and there are just daily and partial downloads. But wait.<\/p>\n<p>I mouse over the Home Directory button, I saw a tar.gz file with a DATE attached to it. I pumped my fist in the air and copy the link, change the date to the day before and downloaded it.<\/p>\n<p>While I waited, I look at the server administrator email and did a google to find out who is the fucker that owns the server whom folders I deleted. Somehow I feel like it is all his fault. It is so nice to blame people at times like these.<\/p>\n<p>Download is done. I unzipped. Took damn long. No luck, the date didn&#8217;t matter, it is a download of the current state of the files.<\/p>\n<p>I have to try system backup. I click on the daily button. I am guessing they back up before I deleted the folders, since I made the changes 1 hour before. It couldn&#8217;t back up that fast. I had to download it before they started the new back up.<\/p>\n<p>Downloading again. Paranoid, I search for the compression ratio of tar.gz. I calculated the current size and checked with my first download. It matched. Add that to the SQL file size and all I need is for this file to be WAY bigger than the first one in size. 641 mb. It&#8217;s a good sign.<\/p>\n<p>I unzipped it. The files shown are weird. I saw a homedir.tar file. 634 mb. Hurray. I unzipped it.<\/p>\n<p>YES.<\/p>\n<p>It is all there. I lost a few files in the end but thats the recent files which I am sure my client still have them in her pc somewhere. In fact, this so called Daily backup is 5 days late. So I have 5 days worth of photos to apologize for in the end. Better than 4 years of photos.<\/p>\n<p>&nbsp;<\/p>\n<p>Hope my experience help you if you are in a similar sticky situation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I am at 2 am and there is an emergency email from a client. Went to the Mac and meddle with some files, trying to right some wrong. Feeling like a boss, I started deleting all the&hellip;<\/p>\n","protected":false},"author":1,"featured_media":2570,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1776],"tags":[1949,1948,1950,1947],"class_list":["post-2569","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding-tutorials","tag-cpanel","tag-emergency","tag-ftp","tag-help"],"acf":[],"_links":{"self":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts\/2569","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2569"}],"version-history":[{"count":0,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/posts\/2569\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=\/wp\/v2\/media\/2570"}],"wp:attachment":[{"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/musenmaker.com\/hazelong\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}