[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: => Backup ?

From: Andy Peters <devel_at_latke.net>
Date: 2006-09-01 04:30:11 CEST

On Aug 31, 2006, at 8:25 AM, Anthony Muller wrote:

> Hello,
>
> What is the simple way to make a repository backup in order to do a
> full restore later (if a problem occurred)?
>
> Is "hotcopy" the best way?

here's a shell script I cooked up.

It assumes the repo is stored in /Volumes/Repodisk/svnowner/svnroot
and hotcopies it to a new directory called /Volumes/Repodisk/svnowner/
svnroot_backup/$DATE. It then tar-gzs the backup. Finally, it scps
it to another machine on the network. Works fine on Mac OS X.
You'll need to make sure your ssh-agent is running.

#!/bin/bash

BASE=/Volumes/Repodisk/svnowner
DATE=`date +%Y%m%d%H%M%S`
SVNROOT=$BASE/svnroot
SVNBKUP=$BASE/svnroot_backup/$DATE
ZIPPED=$BASE/svnroot_backup/$DATE.tar.gz
SCPDEST="svnowner@slug:~/svnroot_backups/"
echo $SCPDEST

echo "Starting svnadmin hotcopy:"
svnadmin hotcopy $SVNROOT $SVNBKUP
echo "Starting archive process:"
tar -cvzf $ZIPPED $SVNBKUP
echo "Copying archive over network:"
scp $ZIPPED $SCPDEST
echo "Done!"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Sep 1 04:31:31 2006

This is an archived mail posted to the Subversion Users mailing list.