2

I accidentally rsync-ed to a server using the delete attribute when I shouldn't have.

Is there any chance of getting the data on the server that rsync removed.. back?

derobert
  • 109,670
john-jones
  • 1,736

1 Answers1

2

This has to do with the filesystem being used, not rsync itself. Assuming ext[234], look at extundelete. There are similar tools for other filesystems.

There is no guarantee that you will get the files back. The files will remain on disk once deleted, but the act of deleting is really marking the space that they occupy as being available to other files again. This means that other files may overwrite the data that once was mapped to that file. For this reason, you should avoid writing data to the filesystem before trying to perform the undeletion.

Chris Down
  • 125,559
  • 25
  • 270
  • 266
  • I ran 'lsof|grep /path/to/file' on the server. And the file is then a file that should be there(but isnt). I get "WARNING: can't stat() xfs file system /var/fake/paigowpi/home2/paigowpi.monthly Output information may be incomplete." I think the data is lost. – john-jones May 08 '13 at 08:35