How to discern when like dir names exist in 2 places

Harry Putnam reader at
Mon Apr 13 19:17:44 MDT 2015

Francis.Montagnac at writes:

> Hi,
> On Mon, 13 Apr 2015 12:59:07 -0400 Kevin Korb wrote:
>> Hmmm,  according to my interpretation of the man page (I am on 3.1.1)
>> that is supposed to work however when I test using the "-/
>> /etc/passwd" example the / seems to have the same effect as commenting
>> the line.  I get /etc/passwd copied whether the source is / or /etc.
> I guess that this -/ syntax is not usable with --exclude, but only
> with --filter.
> Try thus to modify your exclude file to:
>   - /pkg/*
>   - /sadm/*
>   - /cache/*
>   - /opt/csw/cache/*
>   -/ /var/apache2/*
>   - /tmp/*
> an call rsync ... --filter='merge YOUR_FILE' 

I probably should have posted my OP on the rsnapshot list since that
is how this is being done here.

I did mention that early on.

I'm not sure how I would arrange to run rsync as suggested in an
rsnapshot script.

I tried this:

Comment out all mention of an exclude file

Then, where you are to set the arguments to rsync you are supposed to
give both short and long like so:

rsync_short_args  HERE
rsync_long_args   HERE

(The white space before HERE is reqiured to be a tab)

So I tried to use your suggestion by placing it in the long_arg
section like so:

-------       -------       ---=---       -------       ------- 
rsync_long_args   --filter="merge /etc/rsnap/ex/rsnap_2xsMisc_exclude"  --stats --delete --numeric-ids --delete-excluded
-------       -------       ---=---       -------       -------

(The file listed there (/etc/rsnap/ex/rsnap_2xsMisc_exclude) contains
your suggestion)

All those annotated like this:

  - /dir/*

Are excluded, but in both runs... that is, any files below /etc/dir/
and /var/dir/ are excluded.

the one line annotated like:

-/ /var/apache2/*

Appears to just be ignored... and any files under /etc/apache2 or
/var/apache2 are INCLUDED.

I'm beginning to get myself confused... but I suspect I should move
this query to the rsnapshot group and include a pointer to this thread.

More information about the rsync mailing list