Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

2 Answers 2

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.)

share|improve this answer

From server1:

scp root@server2:/backupdir/myfile /mydirectory/myfile
share|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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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