I would like to use 7-zip to backup a directory, but I would like it to exclude all directories named ".svn" (anywhere in the source tree). Does anybody know if this is possible and in that case how?
svn export C:\Path\To\WC C:\Backup\Staging
Then use 7-Zip as follows:
7z.exe a "C:\Parth\To\Archive" "C:\Backup\Staging\*" -bd t7z -v2g -r
Then delete the staging folder.
This is what I do to backup my local working copies.
You can exclude files with 7zip using a list of files or directories:
/path/to7Zip/7z a -bd f:/backup/backup_2009-08-23_daily.zip home \ '-xr@\path\to\backup_daily_exclude.lst'
The exclude file looks like:
home\Photos\iPod* home\dhltd\* BlogMatrix\Sparks\db\*.archive home\eclipse\* .svn
The key is the -xr and in particular the "r" which indicates apply the exclude list recursively, to each level of the directory. You may want to use 2 exclude file lists one for absolute and one for recursive exclusions. The above is from a bash script that runs in cygwin.