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

Re: Incremental backup of the barkley db

From: Michael Andreen <svn-harv_at_ruin.nu>
Date: 2005-01-27 18:23:51 CET

On Thursday 27 January 2005 12.35, Mugabonake Olivier wrote:
> since a few days
> and i have two large projects of 50 GB volume. I want to do incremental
> backups every day and full backups once a mounth. Is up there some
> scripts to do this without backing up all the db?
> thanks

I have the follwing bash script running every day as a cron job:
------------------
OLDREV=`cat /mnt/backup/svnrev`
NEWREV=`svn log -r head file:///var/svn/harv | egrep "r[0-9]+" | cut -d "r" -f
2 | cut -d " " -f 1`

if [ $OLDREV != $NEWREV ]
        then
                OLDREV=$(($OLDREV+1))
                svnadmin dump -r $OLDREV:$NEWREV --incremental /var/svn/harv/
> /mnt/backup/daily/svn-harv-$OLDREV-$NEWREV
                echo -n $NEWREV > /mnt/backup/svnrev
fi
---------------------

This dumps all revisions since last day.

And then I have the following as a weekly job:
-------------------------------------
NEWREV=`svn log -r head file:///var/svn/harv | egrep "r[0-9]+" | cut -d "r" -f
2 | cut -d " " -f 1`

svnadmin dump -r 0:$NEWREV /var/svn/harv/ > /mnt/backup/weekly/svn-harv-`date
+%V`-$NEWREV

echo -n $NEWREV > /mnt/backup/svnrev
----------------------------

Hope it helps.

/Michael Andreen

  • application/pgp-signature attachment: stored
Received on Thu Jan 27 18:26:19 2005

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.