You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Anthony Muller <An...@hyperoffice.fr> on 2006/08/31 15:25:12 UTC
=> Backup ?
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?
How to restore a repository from a hotcopy?
Best regards,
Anthony
----------------------------------------------
Anthony MÜLLER
HyperOffice
E-learning Company
www.hyperoffice.fr
----------------------------------------------
email : anthony.muller@hyperoffice.fr
----------------------------------------------
-----Message d'origine-----
De : Mark Phippard [mailto:markp@softlanding.com]
Envoyé : jeudi 31 août 2006 16:40
À : Chris.Fouts@qimonda.com
Cc : users@subversion.tigris.org
Objet : Re: Please tell me I'm wrong!
<Ch...@qimonda.com> wrote on 08/31/2006 10:18:00 AM:
> svn co svn+ssh://repos/trunk/file
>
> svn: URL 'svn+ssh://repos/trunk/file' refers to a file, not a directory
>
> One can NOT check out a single file in Subversion?
That is correct. You cannot checkout a single file, just a folder. You
can use -N so that subfolders are not checked out.
Mark
---------------------------------------------------------------------
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 ?
Posted by Jan Erik Moström <li...@mostrom.pp.se>.
Being a complete svn newbie and having only some personal repositories I created
a simple post-commit script that sets a flag, once each day another scripts
checks to see if the repository has changed, if so the repository is dumped to
folder. This and other folders are then backed up using dirvish.
Seem to work fine for my requirements.
jem
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: => Backup ?
Posted by Rainer Sokoll <R....@intershop.de>.
On Thu, Aug 31, 2006 at 07:30:11PM -0700, Andy Peters wrote:
> 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.
Here's my solution (with dump, not hotcopy) - it is not perfect:
It reads the repos to dump from a file called "todump", This file
contains the repos in mention line-after line in the form of:
SVNROOT/repo1
SVNROOT/repo2
I have 2 scripts, one for incremental backups, one for full backups. If
the incremental script does not find a full backup, it does a full
backup.
svnbackup.incremental:
------8<----
#!/bin/sh
BACKUPDIR=/svn/backup/incremental/
SVNDIR=/usr/local/subversion-with-ssl-1.3.2/bin/
REPDIR=/svn/svn/
REP=`cat /root/bin/todump`
BZIP2="/usr/bin/bzip2 -9"
for i in ${REP} ; do
if [ ! -d ${BACKUPDIR}${i} ] ; then
mkdir -p ${BACKUPDIR}${i}
fi
CUR_REV=`${SVNDIR}svnlook youngest ${REPDIR}${i}`
LAST_FULL_BACKUP=`ls -1 ${BACKUPDIR}../full/${i}/ | sort -n | tail -1`
# If there is no full backup
if [ x${LAST_FULL_BACKUP} == x ] ; then
/root/bin/svnbackup.full ${i}
else
# actual version higher than last full backup?
if [ ${CUR_REV} -gt ${LAST_FULL_BACKUP} ] ; then
# something changed since the last incremental backup?
LAST_INCREMENTAL_BACKUP=`ls -1 ${BACKUPDIR}${i}/ | sort -n | tail -1`
if [ 0${LAST_INCREMENTAL_BACKUP} -ne 0${CUR_REV} ] ; then
${SVNDIR}svnadmin dump ${REPDIR}${i} --revision \
${LAST_FULL_BACKUP}:${CUR_REV} --incremental | ${BZIP2} > \
${BACKUPDIR}$i/${CUR_REV}
fi
fi
fi
done
------8<----
svnbackup.full:
------8<----
#!/bin/sh
TEMPDIR=/svn/temp/full/
BACKUPDIR=/svn/backup/full/
SVNDIR=/usr/local/subversion-with-ssl-1.3.2/bin/
REPDIR=/svn/svn/
REP=`cat /root/bin/todump`
BZIP2="/usr/bin/bzip2 -9"
if [ x${*} != x ] ; then
# we were called with arguments (from svnbackup.incremental)
if [ ! -d ${BACKUPDIR}${1} ] ; then
mkdir -p ${BACKUPDIR}${1}
fi
CUR_REV=`${SVNDIR}svnlook youngest ${REPDIR}${1}`
if [ ! -d ${TEMPDIR} ] ; then
mkdir -p ${TEMPDIR}
fi
cd ${BACKUPDIR}
mv * ${TEMPDIR}
${SVNDIR}svnadmin --quiet dump ${REPDIR}${1} | ${BZIP2} > \
${BACKUPDIR}${1}/${CUR_REV}
if [ $? -eq 0 ] ; then
cd ${TEMPDIR}
rm -rf *
else
cd ${TEMPDIR}
mv * ${BACKUPDIR}
fi
else
for i in ${REP} ; do
if [ ! -d ${BACKUPDIR}${i} ] ; then
mkdir -p ${BACKUPDIR}${i}
fi
if [ ! -d ${TEMPDIR}${i} ] ; then
mkdir -p ${TEMPDIR}${i}
fi
cd ${BACKUPDIR}
mv ${i}/* ${TEMPDIR}${i}
CUR_REV=`${SVNDIR}svnlook youngest ${REPDIR}${i}`
${SVNDIR}svnadmin --quiet dump ${REPDIR}${i} | ${BZIP2} > \
${BACKUPDIR}${i}/${CUR_REV}
if [ $? -eq 0 ] ; then
cd ${TEMPDIR}
rm -rf *
else
cd ${TEMPDIR}
mv * ${BACKUPDIR}
fi
done
fi
------8<----
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: => Backup ?
Posted by Andy Peters <de...@latke.net>.
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
Re: => Backup ?
Posted by Eric Lemes <er...@gmail.com>.
Hello Anthony,
I use svn hotcopy. The fastest way.
Simply copy your files back to the original location and your backup is
restored.
Eric
2006/8/31, Anthony Muller <An...@hyperoffice.fr>:
>
> 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?
>
> How to restore a repository from a hotcopy?
>
> Best regards,
> Anthony
>
> ----------------------------------------------
> Anthony MÜLLER
> HyperOffice
> E-learning Company
> www.hyperoffice.fr
> ----------------------------------------------
> email : anthony.muller@hyperoffice.fr
> ----------------------------------------------
>
> -----Message d'origine-----
> De: Mark Phippard [mailto:markp@softlanding.com]
> Envoyé: jeudi 31 aoűt 2006 16:40
> Ŕ: Chris.Fouts@qimonda.com
> Cc: users@subversion.tigris.org
> Objet: Re: Please tell me I'm wrong!
>
> <Ch...@qimonda.com> wrote on 08/31/2006 10:18:00 AM:
>
> > svn co svn+ssh://repos/trunk/file
> >
> > svn: URL 'svn+ssh://repos/trunk/file' refers to a file, not a directory
> >
> > One can NOT check out a single file in Subversion?
>
> That is correct. You cannot checkout a single file, just a folder. You
> can use -N so that subfolders are not checked out.
>
> Mark
>
> ---------------------------------------------------------------------
> 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 ?
Posted by "Johnson, Deron" <DL...@firstcommand.com>.
Hotcopy is a VERY simple way to backup. We have batch files that run hotcopy backups multiple times during the day for each repository we have. Restoration onto another machine is easy as well.
-----Original Message-----
From: Anthony Muller [mailto:Anthony.Mueller@hyperoffice.fr]
Sent: Thursday, August 31, 2006 10:25 AM
To: users@subversion.tigris.org
Subject: => Backup ?
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?
How to restore a repository from a hotcopy?
Best regards,
Anthony
----------------------------------------------
Anthony MÜLLER
HyperOffice
E-learning Company
www.hyperoffice.fr
----------------------------------------------
email : anthony.muller@hyperoffice.fr
----------------------------------------------
-----Message d'origine-----
De : Mark Phippard [mailto:markp@softlanding.com]
Envoyé : jeudi 31 août 2006 16:40
À : Chris.Fouts@qimonda.com
Cc : users@subversion.tigris.org
Objet : Re: Please tell me I'm wrong!
<Ch...@qimonda.com> wrote on 08/31/2006 10:18:00 AM:
> svn co svn+ssh://repos/trunk/file
>
> svn: URL 'svn+ssh://repos/trunk/file' refers to a file, not a directory
>
> One can NOT check out a single file in Subversion?
That is correct. You cannot checkout a single file, just a folder. You
can use -N so that subfolders are not checked out.
Mark
---------------------------------------------------------------------
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
STATEMENT OF CONFIDENTIALITY: The information contained in this message or any attachments to this message are intended only for the person(s) or entity to which it is addressed and may contain confidential and/or privileged material as well as being protected from disclosure. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipient is strictly prohibited. If you received this in error, please contact the sender immediately and delete the material from any computer.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org