The script will make a directory called svnbackup/REVISION so that I can easily import them later.
I pulled my nextretro project, and now I just have to decide where to put it.
#!/bin/bash #this script exports any SVN repo to a possibly huge directory export BACKUP_LOCATION='svnbackup' #get the current repo REMOTE_URL=$(svn info| grep -vi "Relative" | grep URL) CURRENT_URL="${REMOTE_URL#*:}" #get this repo version REMOTE_VERSION=$(svn info | grep Revision) CURRENT_VERSION="${REMOTE_VERSION#*:}" # strip out the version number #create the directory mkdir -p $BACKUP_LOCATION svn info > $BACKUP_LOCATION/repo.info echo "backing up current svn: $REMOTE_URL" echo "current version: $CURRENT_VERSION" COUNTER=1 while [ $COUNTER -ne $CURRENT_VERSION ]; do echo Exporting revision: $COUNTER mkdir -p $BACKUP_LOCATION/$COUNTER svn co -r$COUNTER $CURRENT_URL $BACKUP_LOCATION/$COUNTER/. svn log --revision $COUNTER > $BACKUP_LOCATION/$COUNTER/commit.log let COUNTER=COUNTER+1 done
No comments:
Post a Comment