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

Re: making (incremental) backups of a repository

From: Scott Lawrence <slawrence_at_pingtel.com>
Date: 2004-03-24 22:43:23 CET

On Fri, 2004-03-19 at 04:32, Dirk Dierckx wrote:
> Hi,
> I would like to make a full backup every sunday night and an incremental each
> day afterwards until the next sunday. But how do i retrieve the last revision
> stored in the full/prev. incremental backup?

I store it separately. Here's my subversion.daily script. It runs as
the repository owner from crontab - each project has its own repository
under /scm/rep/ and backups go in a parallel directory under /scm/bak/:

### Do daily incremental backups of all subversion projects
Start=`date +%s`
umask 022
cd /scm/rep || exit 1;
for Proj in *
  if [ -d ${Proj} ] && [ -f ${Proj}/format ]
    if [ -s ${INCR} ]
        LAST=`cat ${INCR}`
    HEAD=`svnlook youngest ${Proj}`
    if [ ${LAST} -lt ${HEAD} ]
        if [ ${LAST} -ne 0 ]
        if svnadmin dump --quiet ${type} -r ${RANGE} \
               ${Proj} > ${BAK}/${Proj}.incr.${RANGE}
            echo ${HEAD} > ${INCR}
            echo "Subversion incremental backup failed. ${RANGE}" 1>&2
    echo "Not a subversion repository: /scm/rep/${Proj}" 1>&2
Stop=`date +%s`
Seconds=`echo ${Stop} ${Start} - p | dc`
echo "Subversion Incremental Backups completed in ${Seconds} seconds"

Scott Lawrence        
  Pingtel Corp.   
  sip:slawrence {at} pingtel.com  
  +1.781.938.5306 x162
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Wed Mar 24 22:44:27 2004

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