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

Re: Backup routine for Windows users

From: Andy Peters <devel_at_latke.net>
Date: 2006-10-25 00:44:22 CEST

On Oct 24, 2006, at 3:21 PM, Walden H. Leverich wrote:

> What are others doing to backup/restore multiple repositories in a
> windows environment?

I took a shell script that I wrote for my Mac mini server and
modified it so that it works under Cygwin. It first makes a unique
backup directory (based on the date and time the script runs). Then
it makes a hotcopy of the repo to that backup directory. The backup
directory is tarred and gzipped and finally copied across the network
to a share that's backed up to tape. So the network share has a
bunch of archived versions of the entire repo. Every once in a
while, I go through and delete the really old backups.

I manually run the script every night before leaving the office, as I
haven't figured out how to start a Cygwin shell script from Windows'
Task Scheduler.

Here's the script:

#!/bin/bash

BASE=/cygdrive/c
DATE=`date +%Y%m%d%H%M%S`
SVNROOT=$BASE/svnroot
SVNBKUPDIR=$BASE/svnroot_backup/$DATE
ZIPPED=$BASE/svnroot_backup/$DATE.tar.gz
DEST=/cygdrive/i/apeters/svnroot_backup/$DATE

echo "Making hotcopy directory:"
mkdir -v -p $SVNBKUPDIR
echo "Starting svnadmin hotcopy:"
svnadmin hotcopy $SVNROOT $SVNBKUPDIR
echo "Starting archive process:"
tar -cvzf $ZIPPED $SVNBKUPDIR
echo "Making destination directory:"
mkdir -v -p $DEST
echo "Copying archive over network:"
cp -v $ZIPPED $DEST
echo "Done!"

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 25 00:45:05 2006

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.