[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: Duncan Murdoch <murdoch_at_stats.uwo.ca>
Date: 2006-10-25 01:34:13 CEST

On 10/24/2006 6:44 PM, Andy Peters wrote:
> 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.

I do it by running a batch file from the scheduler. The batch file is a
modified version of the usual cygwin.bat that starts a cygwin window;
the mod is to the line that actually starts cygwin, i.e.

bash --login --init-file /etc/profile -x buildR.sh
>f:\cygwin\home\murdoch\build.log 2>&1

The backslashes are used because it's the Windows CMD interpreter that
runs this line.

Duncan Murdoch

>
> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Oct 25 01:35:02 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.