Re: --detect-renamed --detect-moved and -b
On Wed, 2009-11-11 at 20:27 +0800, Thomas Gutzler wrote: I played around with the combination of rsync --detect-renamed --detect-moved and -b. You can't combine the --detect-renamed and --detect-moved options because they make use of the partial dir in incompatible ways. The last option on the command line takes priority. (Yes, the implementation of --detect-moved is a hack. No, I don't care to improve it myself.) Given the following tree: src/dir/file dest/src/dir/file I renamed src/dir to src/dir2 and ran the following command: rsync -a --detect-renamed --detect-moved --delete -b --backup-dir=bak src dest ending up with: dest/bak/src/dir/file Is it supposed to do that? I was expecting it to detect the renamed directory (or moved file) and exclude it from the backup. Yes, the current design is that a deleted destination file is backed up even if it was also detected as a rename. In addition, your case tickles an awkward-to-fix bug in the --detect-renamed implementation: renames into new directories are not processed because their partial dirs are not available yet. See: http://lists.samba.org/archive/rsync/2007-December/019469.html -- Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: --detect-renamed --detect-moved and -b
Matt McCutchen wrote: On Wed, 2009-11-11 at 20:27 +0800, Thomas Gutzler wrote: I played around with the combination of rsync --detect-renamed --detect-moved and -b. You can't combine the --detect-renamed and --detect-moved options because they make use of the partial dir in incompatible ways. The last option on the command line takes priority. (Yes, the implementation of --detect-moved is a hack. No, I don't care to improve it myself.) I see. That's ok though, because I'm much more interested in the case that a user renames a directory which contained 100G of data than the case that a user renames 100G worth of files. Yes, the current design is that a deleted destination file is backed up even if it was also detected as a rename. In addition, your case tickles an awkward-to-fix bug in the --detect-renamed implementation: renames into new directories are not processed because their partial dirs are not available yet. See: http://lists.samba.org/archive/rsync/2007-December/019469.html Great. I'm running an --include='*/' --exclude='*' anyway, so I've got the directories. Any chance for a --exclude-moved-from-backup flag? Tom -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html
Re: --detect-renamed --detect-moved and -b
On Fri, 2009-11-13 at 14:40 +0800, Thomas Gutzler wrote: Matt McCutchen wrote: You can't combine the --detect-renamed and --detect-moved options because they make use of the partial dir in incompatible ways. The last option on the command line takes priority. (Yes, the implementation of --detect-moved is a hack. No, I don't care to improve it myself.) I see. That's ok though, because I'm much more interested in the case that a user renames a directory which contained 100G of data than the case that a user renames 100G worth of files. You may be misunderstanding the options. --detect-renamed can work across directories, i.e., it detects renames in the sense of rename(2). --detect-renamed-lax is a variation that accepts a destination file that passes the quick check directly instead of just using it as a basis (risky), and --detect-moved is a further variation that requires a basename match (less risky). (Wayne, I told you --detect-moved should have been named --detect-moved-lax!) In addition, your case tickles an awkward-to-fix bug in the --detect-renamed implementation: renames into new directories are not processed because their partial dirs are not available yet. See: http://lists.samba.org/archive/rsync/2007-December/019469.html Great. I'm running an --include='*/' --exclude='*' anyway, so I've got the directories. The point is, the new destination directory has to exist when the old destination file is considered for a rename. Rsync might not have created the new directory yet if it is later in the sort order or if --detect-renamed is piggybacking on --delete-before. Yes, the current design is that a deleted destination file is backed up even if it was also detected as a rename. Any chance for a --exclude-moved-from-backup flag? I'm not going to pursue it myself. -- Matt -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html