You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "Walden H. Leverich" <Wa...@techsoftinc.com> on 2006/10/24 22:21:42 UTC

Backup routine for Windows users

Yes, I know, I could get python and use some of the .py scripts, but
since I don't read/understand python, and don't feel like adding yet
another layer of unknowns into my backup routines, I'm looking for a
more "native" solution to backing up multiple repositories on windows,
specifically when running 1.4 w/BDB and the SVNServe server as a windows
service.
 
As I see it so far, I have the following options:

1.	Stop the svnserve service and simply do a native windows backup
(ntbackup, zip, xcopy, etc.) of the parent directory that holds all my
repositories. Since the service is not running I don't need to worry
about any locking or incomplete updates. This has the advantage of being
downright simple, I backup one directory and get everything. I can
restore everything (catastrophic failure) by restoring the entire
directory tree, or any single repository by restoring the sub-directory
tree for that repository. This has an obvious disadvantage of requiring
a period of downtime to capture the backup. The repositories would be
unavailable for any use, even read-only, during the backup.
Additionally, since BDB never "saw" the backup I'd have to deal with the
old transaction logs.
2.	Use svnadmin hotcopy <repo> --clean-logs. This seems to be
useful in that I don't need to stop the svnserve service to get the
backup also, the clean-logs option will take care of my transaction log
issue. Again, restore is mindless since I simply have to drop the
repository sub-directory tree into the right spot. However, the downside
is that I need to do this on a repository-by-repository basis, plus I'll
need to get my top-level passwd and authz files which live outside of
the repositories.
3.	Use svnadmin dump and dump --incremental. This seems to be the
preferred backup process based on some links I've seen on the net, but
to me it seems silly. svnadmin dump dumps out the contents of the
repository, but not the repository itself, that is, I'd loose any hooks
I'd made since they're not stored _in_ the repository. --incremental is
nice if you want/need small incremental backups, but like any
incremental backup, restore is complicated by the need to restore the
original full backup, followed by all incrementals.

What are others doing to backup/restore multiple repositories in a
windows environment? 
 
-- 
Walden H Leverich III
Tech Software
(516) 627-3800 x3051
WaldenL@TechSoftInc.com
http://www.TechSoftInc.com
<blocked::blocked::http://www.techsoftinc.com/> 

Quiquid latine dictum sit altum viditur.
(Whatever is said in Latin seems profound.)

 

Re: Backup routine for Windows users

Posted by Andy Peters <de...@latke.net>.
On Oct 24, 2006, at 4:34 PM, Duncan Murdoch wrote:

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

Ah, that's cool!

Thanks!

-a

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: Backup routine for Windows users

Posted by Duncan Murdoch <mu...@stats.uwo.ca>.
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

Re: Backup routine for Windows users

Posted by Andy Peters <de...@latke.net>.
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

Re: Backup routine for Windows users

Posted by si <ss...@gmail.com>.
Hi Walden,

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

http://svn.berlios.de/viewcvs/*checkout*/subnant/trunk/README.txt

I'll be implementing the new svnsync into Subnant as an alternative
to the Unison backup process (which has been working well for us)
as soon as I get a chance to come up for air.

Basically we have a post-commit hook call the backup target to
invoke Unison, and a nightly scheduled task to verify all backup
repositories and another scheduled task to do a verify and dump
(compressing the dump to a zip file) of all live repositories.

So at any time we have 2 backups for all our repositories...the most
recent and easiest to recover from is the unison post-commit backup,
since it's a copy of the whole repository directory. The oldest backup
is last nights zip of the dumps. This requires an svnadmin create then
load to recover.

Also, you might want to consider versioning your hooks and authz files
into a repository, and checkout working copies where appropriate.
That way they're covered by whatever process you implement.

peace
si

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org