having a problem with include/exclude logic

Matt McCutchen matt at mattmccutchen.net
Thu Feb 21 19:20:09 GMT 2008

On Thu, 2008-02-21 at 09:20 -0500, Sterling Windmill wrote:
> rsync -avrH --numeric-ids --ignore-errors --delete --delete-excluded
> --stats --filter=". mergelist.dat"
> remoteservername::modulename /localbackupdir
> + /
> + /scratch2/prod_dp_exports/FULL*
> - /scratch2/*
> - /proc/*
> - /sys/*
> - /dev/*

The trouble is that the third rule is excluding
/scratch2/prod_dp_exports , so rsync never even traverses it to notice
the included files inside.  (This aspect of include/exclude rules is
mentioned in the man page (search for the word "ineffectual"), but it
still trips up many users.)  Add a rule "+ /scratch2/prod_dp_exports"
above the "- /scratch2/*".  By the way, you don't need the "+ /" rule
because the only purpose of an include rule is to override a subsequent
exclude rule, but none of your exclude rules match / .


More information about the rsync mailing list