Search code examples
linuxsvncentosrsync

Rsync: Delete, but don't delete .svn subdirectories


I am rsyncing a huge (18000 files) directory, and I need use the --delete option as there is a lot of junk in the destination folder. However, the destination is under SVN revision control, so I need it to keep the .svn/ subdirectories that each directory has. I tried using the --ignore=".svn/" flag but that seems to ignore only what is on the source, and still deletes these directories on the target. Is there any way around this? Both machines are recent CentOS servers.

Thanks.


Solution

  • You probably want the --exclude option; --delete-excluded would allow you to do the opposite, if desired (actually delete excluded files)