Wolter, John D. (GRC-RTE0)
2010-Apr-22 16:04 UTC
--exclude-from and a directory name that contains a hyphen
I'm having a problem with an exclude list and I wanted to run it by the group before I cry "Bug!". Here's the scenario: I'm working on a script to selectively synchronize several directories with those on a server using rsync (version 3.0.5 protocol version 30). I am using the --exclude-from command option, and everything works, except when a directory I am specifying contains a hyphen. Then I can't get a pattern match and the directory (and all its children) will not sync. I have tried to escape the hyphen with a backslash, and replace it with an ampersand or a dot or an asterisk to wild card it. The command I am using is: rsync -avze ssh --dry-run --exclude-from=/home/user/excl.tmp server01:/usr2/ /home/user/usr2/ Examples of excl.tmp file. This works: + /gale + /gale/tools + /gale/tools/** - * This doesn't work (it only syncs the directory file named gale): + /gale + /gale/solver-alpha + /gale/solver-alpha/** - * Note that rsync will happily sync other files with a hyphen in the name, it just fails to pattern match them when they are specified in the exclude file. Furthermore, I tried it out on another machine with rsync 2.6.8 and it works. I went back to my original machine and upgraded rsync to 3.0.7 and still no luck. I looked at Bugzilla and didn't see any items covering this, though I might have missed something, particularly if I'm just seeing the tip of an iceberg. Can anyone reproduce this so I know it's not just something I'm doing wrong? Other details: The local machine is running ubuntu 9.04, while the remote server is running RedHat Enterprise Linux 5.4. The other machine (on which rsync 2.6.8 is installed) is also running RHEL 5.4. John D. Wolter Aerospace Engineer NASA Glenn Research Center -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20100422/4e26359c/attachment.html>
Wayne Davison
2010-May-03 00:45 UTC
--exclude-from and a directory name that contains a hyphen
On Thu, Apr 22, 2010 at 9:04 AM, Wolter, John D. (GRC-RTE0) < john.d.wolter at nasa.gov> wrote:> This doesn't work (it only syncs the directory file named gale): > + /gale > + /gale/solver-alpha > + /gale/solver-alpha/** > - * >That should work fine, and is unlikely to be an rsync bug. I'd imagine there is some slight difference between the actual dir name and the include line. e.g., make sure there is not a trailing space on the line that includes the solver-alpha directory. Make sure that the dirname exactly matches that in both case and characters. Make sure that there aren't any earlier exclude rules superseding those rules (is that the only exclude file?) If you can't see an issue, try adding a second -v option to the transfer and reading the "hiding" message that rsync outputs, such as: [sender] hiding file gale/Solver-alpha because of pattern * If there is the possibility of other "- *" rules existing, you can tweak the one above to be "- **" (with a superfluous '*') so you can make sure that you see "because of pattern **" in the output. ..wayne.. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.samba.org/pipermail/rsync/attachments/20100502/c3640262/attachment.html>