0

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?

hfranco
  • 585
  • 2
  • 9
  • 25

2 Answers2

2

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

Dan Andreatta
  • 5,454
  • 2
  • 24
  • 14
1

From server1:

scp root@server2:/backupdir/myfile /mydirectory/myfile
Jake Wilson
  • 8,814
  • 29
  • 97
  • 125