Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

recover deleted files- how? 1

Status
Not open for further replies.

rushtosiva

Programmer
Dec 5, 2000
7
US
Hi all
Can anyone suggest me a way to configure lost+found so that the deleted files are automatically transferred to that directory.

Thanks and regards
Siva
 
Happy New Year, Silva!!!

Of the many questions, the first is, have you discussed this with your System Admin? He/she should be able to provide the answer.
Assuming no admin is available and that the files cannot be restored from previous backups, let's start with a few questions.
Do you wish to save only one user's deleted files, such as yours? Or, do you wish to save the deleted files of all users?
And, do you want only deleted files resulting from "rm" and "mv"? Do you want the files deleted from a program's system call such as "unlink"?
Does your system have the resources for the additional overhead? Keep in mind how many files are expected to be deleted. One user deleting many files or many users deleting a few files can eat up disk space quickly. Also, the routine used could "hog" your cpu and/or memory. Even a one or two second delay will trigger a barrage of calls to the system admin or the IT staff.
Any other pertinent information would be helpful.
A quick summary of my own experience is that no matter which script or commercial application, the resulting restrictions or overhead was not worth the effort. We decided to restrict the two "problem users" from deleting any files.




 
Silva,

There's no standard way of recovering deleted files or of having them automatically transferred to lost+found.

As jmdonovan says, you have to restore the deleted files from your backups.

Mike
michael.j.lacey@ntlworld.com
 
You can make your own rm.
You can alias it for the user from who you want to save
there deleted files.

RMF(){
if [ -f $1 ] ;then
mv $1 deletedfiles/$1.`date +%whatever`
fi
}
alias rmf=RM

and let the users use rmf instead of rm.

I would not alias rm. Leave it as it is.

Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top