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

Re: Backup using ZFS Snapshots

From: Mark Phippard <markphip_at_gmail.com>
Date: Tue, 13 Dec 2016 16:59:50 -0500

On Tue, Dec 13, 2016 at 4:44 PM, Andrew Martin <amartin_at_xes-inc.com> wrote:

> ----- Original Message -----
> > From: "Stefan Sperling" <stsp_at_elego.de>
> > To: "amartin" <amartin_at_xes-inc.com>
> > Cc: "users" <users_at_subversion.apache.org>
> > Sent: Tuesday, December 13, 2016 3:29:50 PM
> > Subject: Re: Backup using ZFS Snapshots
>
> > On Tue, Dec 13, 2016 at 03:17:53PM -0600, Andrew Martin wrote:
> >> Hello,
> >>
> >> I am running a Subversion 1.9.3 server on Ubuntu 16.04. I currently use
> >> svnadmin hotcopy to safely backup the SVN repositories, but since the
> >> repositories are now hosted on a ZFS dataset, I would like to utilize
> ZFS's
> >> snapshot capabilities to create atomic, point-in-time backups of the
> >> repositories. My plan to do this is as follows:
> >>
> >> 1. create zfs snapshot
> >> 2. clone zfs snapshot and mount at a temporary location
> >> 3. run svnadmin hotcopy from the mounted clone to safely create a backup
> >> 4. umount and destroy clone
> >>
> >> My only concern is if a commit is in-progress when the zfs snapshot
> occurs,
> >> would svnadmin hotcopy still be able to safely handle creating the
> backup?
> >>
> >> Is this a safe procedure for creating backups?
> >
> > You don't need to hotcopy at all if you have filesystem snapshots.
> > Check out 'svnadmin freeze'. It was made for this use case.
>
> Thanks for the quick reply - 'svnadmin freeze' looks useful for this
> purpose.
>
> Is there a way to freeze the repository with a command and then unfreeze it
> with another command? I'd ideally like to run several commands on different
> servers while the repository is frozen.
>

If you can use freeze it is a good solution but it is one repository at a
time. The svnbook gives a good example using rsync and freeze to do
backups: http://svnbook.red-bean.com/en/1.8/svn.ref.svnadmin.c.freeze.html

If all of your activity happens via Apache there might be easier ways to
make all your repositories read only during a backup window and you can
also always use the start-commit hook as an easy way to make repositories
read only.

-- 
Thanks
Mark Phippard
http://markphip.blogspot.com/
Received on 2016-12-13 23:01:04 CET

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.