Here is my little script for `incremental’ dump svn revision trees. The script just check every svn repositories which located at /home/svn, and save it in /home/backup by versions.

#!/bin/sh

for dir in /home/svn/* ; do
    name=$(basename ${dir})
    version=$(svnlook youngest ${dir})
    for ((r=1;r<${version};r++)) ; do
	if [ ! -f "/home/backup/${name}-$r.gz" ] ; then
		svnadmin dump ${dir} -r $r --incremental | \
			gzip -9> /home/backup/${name}-$r.gz
	fi
    done
done

Have fun! This is a tip.

  • Rex,

    很感謝您提供這個好用的 script,我有將之改成 perl 的版本放在我的 wiki 頁面 (http://www.ichiayi.com/wiki/tech/subversion)

    如果這樣會讓您覺得有困擾,再請通知我.. Tks.

    Jonathan.

  • @Jonathan Tsai, Please feel free to use that code. It’s great to see my small code help people. 🙂