Bug 7927 - Rsync does not sync folders named "tags"
Summary: Rsync does not sync folders named "tags"
Status: CLOSED INVALID
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.3
Hardware: x86 Linux
: P3 major (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-20 02:30 UTC by Xanadonf
Modified: 2011-01-20 10:08 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Xanadonf 2011-01-20 02:30:36 UTC
All is in the subject.
An example below, on stable debian.

Regards,
Antony


[0]root@debian-lenny32:/tmp # tree
.
|-- a
|   |-- file2
|   |-- file3
|   |-- logs
|   |   `-- log1
|   `-- tags
|       `-- file1
|-- b
`-- rsync_exclude.txt

4 directories, 5 files
[0]root@debian-lenny32:/tmp # cat rsync_exclude.txt
/logs
[0]root@debian-lenny32:/tmp # rsync  -azC --force --delete --progress --exclude-from=rsync_exclude.txt a/ b
sending incremental file list
./
file2
           2 100%    0.00kB/s    0:00:00 (xfer#1, to-check=1/3)
file3
           2 100%    1.95kB/s    0:00:00 (xfer#2, to-check=0/3)

sent 142 bytes  received 53 bytes  390.00 bytes/sec
total size is 4  speedup is 0.02
[0]root@debian-lenny32:/tmp # tree
.
|-- a
|   |-- file2
|   |-- file3
|   |-- logs
|   |   `-- log1
|   `-- tags
|       `-- file1
|-- b
|   |-- file2
|   `-- file3
`-- rsync_exclude.txt

4 directories, 7 files
Comment 1 Paul Slootman 2011-01-20 06:06:37 UTC
You do understand the implications of all the command line switches you're passing to rsync, right? Quoting from the manpage:

-C, --cvs-exclude
       This is a useful shorthand for excluding a broad range of  files
       that you often don't want to transfer between systems. It uses a
       similar algorithm to CVS  to  determine  if  a  file  should  be
       ignored.

       The  exclude  list is initialized to exclude the following items
       (these initial items are marked as perishable -- see the  FILTER
       RULES section):

              RCS   SCCS   CVS   CVS.adm   RCSLOG  cvslog.*  tags  TAGS
              .make.state .nse_depinfo *~ #* .#* ,* _$* *$ *.old  *.bak
              *.BAK  *.orig *.rej .del-* *.a *.olb *.o *.obj *.so *.exe
              *.Z *.elc *.ln core .svn/ .git/ .bzr/

[...]

As you can see, "tags" is included in the list of things to exclude when using -C, hence rsync is working exactly the way you asked it to.
Comment 2 Matt McCutchen 2011-01-20 06:49:01 UTC
Thanks, Paul.
Comment 3 Xanadonf 2011-01-20 08:03:32 UTC
Sorry if you had a sad morning Paul !

I do not read rsync manual each day of my life. 
I should read it each time I have a problem, my fault.
I should read it each time I have a problem, my fault.
I should read it each time I have a problem, my fault.
I should read it each time I have a problem, my fault.
I should read it each time I have a problem, my fault.
I should read it each time I have a problem, my fault.
...

Regards,
Antony
Comment 4 Wayne Davison 2011-01-20 10:08:08 UTC
I'll also mention that you can ask rsync to include directories named "tags" via --include=tags/ and it will then only exclude files named "tags" (via -C).  The rules injected by -C come at the end of the rules (by default) so, any exclude/include rules you specify will override -C rules.