I ran rm -drf on my web server and accidentally removed everything inside /var/www/.
Of course, it had everything for our website in it. How can I undo this? Or is it possible to restore it to a previous version?
|
I ran Of course, it had everything for our website in it. How can I undo this? Or is it possible to restore it to a previous version? |
|||
|
In some instances you can recover portions of deleted files from a linux filesystem but it is hard. Honestly, human error is the biggest cause of IT outages, and your best solution is to be proactive in backing up regularly as well as using a version control system like mercurial. I realize this may be pouring salt on the wound, but it's worth pointing out... The damage is done. The best help you can get now is to regain your composure, and get ready for an honest conversation with your boss. I would bet you're new to IT. While your boss may be angry, most people understand that human error happens, and it is part of learning. Just be sure you don't make yourself a target by doing this often |
|||||||||||||||
|
|
Backups of anything and everything should be standard practice. Also, for the web developers, they should be developing in some sort of version control (CVS, SVN, Git, etc.) on a different machine than the production web server, then checking it out on the server. Unfortunately, all hope is probably lost by now. If anything like this happens in the future, and there are no backups, subversion, etc. pretty much your only option is to as quickly as possible unmount the drive. Then, you may have a chance of recovering the data before it's overwritten with anything else. As a last-ditch, KISS effort... perhaps whoever was working on the site SCP'ed it over from their workstation and still has the files locally? |
|||
|
|
|
I would recommend using a tool like http://www.cgsecurity.org/wiki/TestDisk which has helped me in the past to find and recover deleted files, or I would recommend looking to see who uploaded the files most recently in the past. |
|||
|
|
|
There are tools. There is specialized distro for that, but i think list of programs they use should do. If you want distro it self just press download on the left panel. http://www.sysresccd.org/System-tools#recovery_tools I must say that even recovering system files that will be damaged hard! I did formated my girlfriends HDD and then tried to restore it. It took ~12 hours and i saved ~3% of files because i left it [HDD] running. As soon as you do the mistake it need to unplug/unmount that HDD. As one of the people in here said - give the job to the professionals. They could restore much more. To prevent such mistakes i strongly suggest to use P.S. I haven't mentioned backups and version control systems because it's common practice and everybody else mentioned it. From my point of view - just use it and listen what people say here. |
|||||
|
|
Painful indeed, last time i had this kind of mistake, i plugged my hardisk with an external usb on my windows machine and i used a flash drive photo recovery software to recover my files partly. One good advice is not to use this hard drive until you can recover your files, because writting new data will make your old stuff disappear for ever. google flash drive recovery tool, there are lots of them that are free. There is still hope |
|||||||
|
|
I am so sorry to tell you that, it is going to be really difficult. If you want to try recovering it by yourself, i ll attach one pdf which i made from some site(which i dont remember now). It has some steps to do that. But dont try if you strongly feel that you cant do it. |
|||||||
|
rmbut you can get fired for not making (and testing) daily backups of data. – RedGrittyBrick May 9 '11 at 9:20