If you need to backup your SVN repositories, then you can use this bash script to do so:

#!/bin/bash
DATE=`date +"%Y-%m-%d"`
BACKUP_DIR=/home/user/svn/backup/${DATE}
mkdir -p $BACKUP_DIR
for dir in `ls /var/svn/`; do
    RES_DIR=/var/svn/$dir;
    svnadmin dump $RES_DIR | gzip > "${BACKUP_DIR}/${dir}.dump.gz";
done

This basically dumps every revision from each repository in your server, and gzip’s them and then puts them in /home/user/svn/backup under the current date

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.