#!/bin/sh PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin export PATH DATE=`date +%Y%m%d` BK_DIR="/tmp/svn_bak" SVN_DIR="/svndata/cloudil" BAK_VER=`ssh *.*.*.* "svnlook youngest $dir"` if [ ! -d $BK_DIR ] then /bin/mkdir -p $BK_DIR fi NOW_REV=`svnlook youngest $SVN_DIR` echo now $NOW_REV bak $BAK_VER svnadmin dump $SVN_DIR -r $BAK_VER:$NOW_REV --incremental > $BK_DIR/${DATE}_svncloudil scp $BK_DIR/${DATE}_svncloudil *.*.*.* :/$dir ssh *.*.*.* "/usr/bin/svnadmin load /$dir < /cache/xasvn/${DATE}_svncloudil" ssh *.*.*.* "/bin/chown -R apache:apache /$dir" find ${BK_DIR}/ -mtime +15 -exec rm -f {} ; ssh *.*.*.* "find /cache/xasvn/ -mtime +15 -exec rm -f {} ;"