Creation des snapshots LVM en lecture seule

This commit is contained in:
Daniel Berteaud 2012-06-17 21:14:05 +02:00
parent 5eb192546c
commit 8ce4f5e497

View File

@ -4,7 +4,7 @@
# Daniel Berteaud <daniel@firewall-services.com> # Daniel Berteaud <daniel@firewall-services.com>
# #
# COPYRIGHT # COPYRIGHT
# Copyright (C) 2009-2011 Daniel Berteaud # Copyright (C) 2009-2012 Daniel Berteaud
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -605,7 +605,7 @@ sub create_snapshot{
my $ret = 0; my $ret = 0;
print "Running: $opts{lvcreate} -p r -s -n " . $blk . $suffix . print "Running: $opts{lvcreate} -p r -s -n " . $blk . $suffix .
" -L $opts{snapsize} $blk > /dev/null 2>&1\n" if $opts{debug}; " -L $opts{snapsize} $blk > /dev/null 2>&1\n" if $opts{debug};
if ( system("$opts{lvcreate} -s -n " . $blk . $suffix . if ( system("$opts{lvcreate} -p r -s -n " . $blk . $suffix .
" -L $opts{snapsize} $blk > /dev/null 2>&1") == 0 ) { " -L $opts{snapsize} $blk > /dev/null 2>&1") == 0 ) {
$ret = 1; $ret = 1;
open SNAPLIST, ">>$backupdir.meta/snapshots" or die "Error, couldn't open snapshot list file\n"; open SNAPLIST, ">>$backupdir.meta/snapshots" or die "Error, couldn't open snapshot list file\n";