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.