Quote:
Originally Posted by ashok.g
Hi folks,
I deleted a symbolic link file. That deleted the source directory also.
Is there a way to retrieve the deleted directory?
I found a link for this. But I am unable to unmount the file system as there is only one partition /dev/hda1.
Can anyone give some good solution to getback my deleted directory?
|
I hope you make regular backups... But I have the feeling you did not.
My experience with Linux is that a removed tree is hard to get back. There's no undelete like in DR-DOS.
I regularly run a simple backup script that puts all the volatile data (i.e. no photo's, films and music) in a tar file in /Backup. If I now accidentally loose a tree or a trunk, I just consult the tar file in /Backup and get back as much as I can.
This is my script:
Code:
#! /bin/sh
if (! rm /Backup/BeBackup.tar 2> /dev/null 1> /dev/null) then
echo No /Backup/BeBackup.tar file found.
fi
tar cf /Backup/BeBackup.tar /home --exclude=Keep/* --exclude=Cache/* --exclude=jpg/*
Be (short for Beryllium) is the name of the machine. BeBackup is the backup fle.
The script will include all of the /home tree except
- all files in the 'Keep/' directories,
- all files in 'Cache' directories (your webbrowsers)
- all files in 'jpg/' directories
This won't retrieve the files you lost yesterday, but it'll save your future.
I'd better learn from your experience and make a cronjob that makes daily backups towards /Backu and regularly burn a CD or DVD...