Roland Friedwagner
2011-Dec-13 16:30 UTC
Dir-merge exclude filter ignored when rsync DEST ends in /.
Hi, I encountered this behavor when switching my excludes from global exclude filter rules to dir-merge rules. If the spezified DEST directory has a trailing dot dir the exclude filter rule "exclude /foobar" inherited from dir-merge is ignored and the file gets deleted. But I'm not quite sure if this behavor is a bug or feature. Test: $ mkdir src $ touch src/object $ echo "exclude /object" > s/.rsync-filter bash: s/.rsync-filter: No such file or directory $ echo "exclude /object" > src/.rsync-filter $ cp -a src dst $ ls -flra src dst src: insgesamt 4 drwxrwxr-x 2 abcde abcde 39 2011-12-13 16:41 . drwxrwxr-x 4 abcde abcde 26 2011-12-13 16:41 .. -rw-rw-r-- 1 abcde abcde 0 2011-12-13 16:41 object -rw-rw-r-- 1 abcde abcde 16 2011-12-13 16:41 .rsync-filter dst: insgesamt 4 drwxrwxr-x 2 abcde abcde 39 2011-12-13 16:41 . drwxrwxr-x 4 abcde abcde 26 2011-12-13 16:41 .. -rw-rw-r-- 1 abcde abcde 0 2011-12-13 16:41 object -rw-rw-r-- 1 abcde abcde 16 2011-12-13 16:41 .rsync-filter $ rsync -n -avF --delete src/ dst/. building file list ... done deleting object <== delete ! sent 97 bytes received 20 bytes 234.00 bytes/sec total size is 16 speedup is 0.14 $ rsync -n -av --filter ": .rsync-filter" --delete src/ dst/. building file list ... done deleting object <== delete ! sent 97 bytes received 20 bytes 234.00 bytes/sec total size is 16 speedup is 0.14 These DEST directory spezifications works as expected (e.g. /object file is ignored): $ rsync -n -avF --delete src/ dst building file list ... done sent 97 bytes received 20 bytes 234.00 bytes/sec total size is 16 speedup is 0.14 $ rsync -n -avF --delete src/ dst/ building file list ... done sent 97 bytes received 20 bytes 234.00 bytes/sec total size is 16 speedup is 0.14 $ rsync -n -avF --delete src/ dst/./ building file list ... done sent 97 bytes received 20 bytes 234.00 bytes/sec total size is 16 speedup is 0.14 Tested rsync versions: rsync version 2.6.9 protocol version 29 rsync version 3.0.9 protocol version 30 Kind Regards, Roland -- Roland.Friedwagner at wu.ac.at Phone: +43 1 31336 5377 IT Services - WU (Vienna University of Economics and Business)
Apparently Analagous Threads
- hardlinking missing files from src to a dest: didn't work way I thought it would.
- [Bug 1993] ssh tries to add keys to ~/.ssh/known_hosts though StrictHostKeyChecking yes is set
- hardlinking missing files from src to a dest: didn't work way I thought it would.
- Asterisk 11 SRTP: unsupported crypto parameters: UNENCRYPTED_SRTCP
- AV messages and the digest