You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ronan <ro...@furioustribe.com> on 2012/02/15 12:35:25 UTC
backups using LVM snapshots and "svnadmin lstxns"
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.
Re: backups using LVM snapshots and "svnadmin lstxns"
Posted by Daniel Shahaf <d....@daniel.shahaf.name>.
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.