Rsync, subversion and directories

Andrew Crouch andrew.crouch at gmail.com
Fri Nov 11 05:20:09 GMT 2005


Hi all,
        I'm attempting to build a backup system using rsync and subversion.

I have a samba share which I would like to replicate via rsync.  The
replicated copy is under subversion control to store a 'history'. 
This appears to work well until a directory is removed on the primary
(non-backup) file system.

The rsync command which I assumed would do the job:
$ rsyc -zrv --delete --force --exclude=".svn" SRC DEST

Since the destination folders are under subversion control, each
folder has a ".svn" folder holding the versioning information.  I
would prefer these not be deleted each time rsync ran, hence the
--exclude=".svn" flag.  However, when a folder is removed on the
source machine I would like that folder to disappear on the
destination machine, ".svn" subdirectory and all.  Reading the short
description of "--force", it appears this flag should do the trick -
further investigation reveals this is not quite so.

Furthermore, the output of the "-v" flag doesn't imply that the
directory can be deleted, except when doing a dry run:

$ rsync -rvz --delete --exclude=".svn" --dry-run  ~/TestA ~/testme/TestB
building file list ... done
deleting TestA/TEST/     <-------
TestA/blerg.txt
TestA/file with space.txt
TestA/file2.txt
TestA/sync.sh

$ rsync -rvz --delete --exclude=".svn" ~/TestA ~/testme/TestB
building file list ... done
TestA/blerg.txt
TestA/file with space.txt
TestA/file2.txt
TestA/sync.sh

I was wondering, short of moving the subversion server to the source
machine, or running rsync twice and doing some output matching, how
this might be accomplished?

Cheers,
Andrew


More information about the rsync mailing list