Make rsync exclude subversion working directories

Matt McCutchen hashproduct at verizon.net
Sun Apr 2 23:57:55 GMT 2006


On Sun, 2006-04-02 at 17:04 +0100, Martin Scharrer wrote:
> I naive try with a filter rule like "- .svn/../", which should exclude all 
> parent dirs of the '.svn' dirs, doesn't work. Ok, this does not suprise me.

Right, because rsync matches the pattern against the canonical path to
each file it finds instead of following the pattern in the filesystem in
all possible ways.  The filter rule with a double slash that someone
recently tried to use failed for the same reason.

> Is there any fast and good way to do this without writting a script which scan 
> for the dirs, which would be the alternative. 
> ( for example:
> rsync ${OPTIONS} --filter=._<(cd $FROM && find -type d -name .svn -printf 
> "%h\n" | sed 's_\./_- _') $FROM $TO
> )

That technique is probably best.  Something else you might try: name all
working copies from repositories that you back up separately with a
suffix like -wc or -svn so that a single exclude rule can match them
all.

-- 
Matt McCutchen
hashproduct at verizon.net
http://hashproduct.metaesthetics.net/



More information about the rsync mailing list