Coding
ShareThis
Hide this post

m
Restoring Deleted Files in FTP via Cpanel

80 days ago in Coding

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.

I started sweating. Images of cigarettes appear in my head. I sat there stoned. Ok calm down. Solutions solutions.

Option 1// .trash Folder

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

Option 2// SSH

Ok ok. fine fine. I’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 – I feel like a hacker. No time to gloat, SSH settings here we go.

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’s that search function for Terminal again. I can’t remember. Damn.

Screen Shot 2011 12 06 at 4.14.12 AM 500x227 : Restoring Deleted Files in FTP via Cpanel

Option 3//Backups in cPanel

Not likely to work. Since it wasn’t set up and there are just daily and partial downloads. But wait.

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.

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.

Download is done. I unzipped. Took damn long. No luck, the date didn’t matter, it is a download of the current state of the files.

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’t back up that fast. I had to download it before they started the new back up.

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’s a good sign.

I unzipped it. The files shown are weird. I saw a homedir.tar file. 634 mb. Hurray. I unzipped it.

YES.

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.

 

Hope my experience help you if you are in a similar sticky situation.

Clickable banners for your Facebook fan page.

How to use a big banner for your Facebook page

Note the icons for the search bar, email icon in the social sharing area and the number 5 background

Brief CSS Workflow tutorial without design

/images/default.jpg

Installing Image Magick for Paperclip on Centos 5

/images/default.jpg

Deploying Rails to Centos : Capistrano

/images/default.jpg

Deploying Rails to Centos 5 : Gitosis

/images/default.jpg

Deploying Rails to Centos 5 : Passenger

/images/default.jpg

Deploying Rails to Centos 5 : Ruby, Gems & Rails

/images/default.jpg

Deploying Rails to Centos 5 : Git

/images/default.jpg

Deploying Rails to Centos 5 : mySQL

/images/default.jpg

Deploying Rails to Centos 5 : Apache

http://hazelong.com/wp-content/uploads/2010/12/Picture-6-500x411.png

Guide to HTML5 new tag elements