rsync unexpectedly removing ALL files

Koehn, Troy N. TNKoehn at west.com
Mon Jun 6 15:52:28 UTC 2016


I am using rsync with --files-from option with a file named 'rsync.in' that contains 37K+ directories that are queried from a database. One of the directories in the database actually looked like this:

/home/usr/directory/./

Probably some sort of typo when the directory was entered. When performing the rsync command below, this one directory caused all files on the destination server to be deleted from the root '/' directory on down. Obviously I have put in safeguards now to filter invalidly formatted directories, but I want to understand why rsync would do this in case there are other things I should be looking for. BTW, it only seems to happen if using the -files-from option. If ran manually from the command line it does not delete all files. I have searched the web and can find no one else who has experienced this.

Note: If you test this, please use the -dry-run option

rsync --dry-run --perms --delete --compress --dirs --links --times --keep-dirlinks --files-from=rsync.in source_machine:/home/src/shared/directory/ /


Thanks for any assistance.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.samba.org/pipermail/rsync/attachments/20160606/9a069743/attachment.html>


More information about the rsync mailing list