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

Re: backups using LVM snapshots and "svnadmin lstxns"

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Wed, 15 Feb 2012 17:48:51 +0200

Please read the in the archives the thread taking place YESTERDAY that
discusses LVM snapshots and validity. If you still have any questions
after reading it --- do ask.

Cheers,

Daniel

Ronan wrote on Wed, Feb 15, 2012 at 11:35:25 +0000:
> I want to back up a filesystem on a Linux machine, by taking
> an LVM snapshot of the filesystem then copying it to a remote
> server. However, there are Subversion repositories on the
> filesystem, and I'm concerned that there could be a commit
> under way to one or more of these repositories at the instant
> that I take the snapshot, which could result in my getting a
> corrupted SVN repository in the backup.
>
> I think I have a solution to this problem, which I present in
> the following PHP code. (It should be intelligible to anyone
> who knows a C-like language.) Does anyone know whether the
> solution will work?
>
> ######### code begins here
>
> do {
> make_snapshot();
>
> $transaction_found = FALSE;
>
> foreach ($repository_on_snapshot as $dir) {
> if(system("svnadmin lstxns $dir") !== '') {
> $transaction_found = TRUE;
> break;
> }
> }
> } while($transaction_found);
>
> # all the SVN repositories are consistent,
> # so continue with the backup...
>
> ######### code ends here
>
> The SVN book strongly implies that the solution will work,
> but I would prefer to have an explicit assurance on this point.
>
> I'm not subscribed to this list, so please copy me on any
> replies.
Received on 2012-02-15 16:49:35 CET

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