#!/bin/bash###################################### author: www.ttlsa.com ###### QQ群: 39514058 ###### E-mail: service@ttlsa.com ######################################SVN_REPOS=(/www/svn/web/*.ttlsa.com)BACKUP_BASE_DIR=/www/repo_backupbackup_rotate() {if cd $1thenfor num in 7 6 5 4 3 2 1doold=`expr $num + 1`if [ -d backup.${num} ]thenif [ -d backup.${old} ]thenrm -rf backup.${old} && mv backup.${num} backup.${old}elsemv backup.${num} backup.${old}fifidoneelseecho "change BACKUP_DIR error!"exit 1fi}for REPO in "${SVN_REPOS[@]}"doREPONAME=`/usr/bin/basename $REPO`BACKUP_DIR="$BACKUP_BASE_DIR/$REPONAME"[ -d "$BACKUP_DIR" ] || mkdir -p $BACKUP_DIRcd $BACKUP_DIR && backup_rotate $BACKUP_DIR/usr/bin/svnadmin hotcopy $REPO $BACKUP_DIR/backup.1done转载请注明出处:http://www.ttlsa.com/html/1261.html