I need to recover files that have been deleted.

My scenario:

I have a rsync script that runs at 9PM and mirrors everything from server1 directory to another directory on backup server2.

A couple of files have been accidentally deleted from server1.

How do I recover those files from server1 with rsync?

link|improve this question

75% accept rate
feedback

2 Answers

up vote 2 down vote accepted

You should be able to do so with the --update option. According to the man page

This forces rsync to skip any files which exist on the destination and have a modified time that is newer than the source file. (If an existing destination file has a modification time equal to the source file's, it will be updated if the sizes are different.)

link|improve this answer
feedback

From server1:

scp root@server2:/backupdir/myfile /mydirectory/myfile
link|improve this answer
Not really what I'm looking for. I'm trying to recover only the deleted files, not the entire directory. – hfranco Apr 21 '10 at 20:16
Ah okay. I assumed you had a list of specific files that were deleted. – Jakobud Apr 22 '10 at 17:20
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.