[-]
[+]
|
Added |
rsnapshot.changes
|
|
[-]
[+]
|
Changed |
rsnapshot.spec
^
|
|
[-]
[+]
|
Added |
rsnapshot-configure_check-lvm-cmds.patch
^
|
@@ -0,0 +1,173 @@
+--- configure.ac.orig 2011-11-07 12:24:04.962394552 +0100
++++ configure.ac 2011-11-07 12:32:59.006960210 +0100
+@@ -245,7 +245,170 @@
+ dnl either way, set the cmd_ssh var
+ AC_SUBST(CMD_DU, "cmd_du $DU")
+
++dnl
++dnl LVCREATE CHECK (optional program)
++dnl
++dnl if the user specified a path, try that first
++AC_ARG_WITH(lvcreate,
++ [ --with-lvcreate=PATH Specify the path to lvcreate ],
++ [
++ if test "x$withval" != "xno"; then
++ if test -x "$withval"; then
++ LVCREATE=$withval
++ else
++ AC_MSG_ERROR(lvcreate not found)
++ fi
++ else
++ LVCREATE=no
++ fi
++ ]
++)
++dnl save the program for testing
++AC_SUBST(TEST_LVCREATE, "$LVCREATE")
++dnl if the user didn't specify a path, hunt for it
++if test "$LVCREATE" != "no"; then
++ if test "$LVCREATE" = ""; then
++ AC_PATH_PROG(LVCREATE, lvcreate, no)
++ fi
++fi
++dnl if we couldn't find it, provide an example
++if test "$LVCREATE" = "no"; then
++ LVCREATE=/sbin/lvcreate
++fi
++dnl either way, set the cmd_lvcreate var
++AC_SUBST(CMD_LVCREATE, "linux_lvm_cmd_lvcreate $LVCREATE")
+
++dnl
++dnl LVREMOVE CHECK (optional program)
++dnl
++dnl if the user specified a path, try that first
++AC_ARG_WITH(lvremove,
++ [ --with-lvremove=PATH Specify the path to lvremove ],
++ [
++ if test "x$withval" != "xno"; then
++ if test -x "$withval"; then
++ LVREMOVE=$withval
++ else
++ AC_MSG_ERROR(lvremove not found)
++ fi
++ else
++ LVREMOVE=no
++ fi
++ ]
++)
++dnl save the program for testing
++AC_SUBST(TEST_LVREMOVE, "$LVREMOVE")
++dnl if the user didn't specify a path, hunt for it
++if test "$LVREMOVE" != "no"; then
++ if test "$LVREMOVE" = ""; then
++ AC_PATH_PROG(LVREMOVE, lvremove, no)
++ fi
++fi
++dnl if we couldn't find it, provide an example
++if test "$LVREMOVE" = "no"; then
++ LVREMOVE=/sbin/lvremove
++fi
++dnl either way, set the cmd_lvremove var
++AC_SUBST(CMD_LVREMOVE, "linux_lvm_cmd_lvremove $LVREMOVE")
++
++dnl
++dnl MOUNT CHECK (optional program)
++dnl
++dnl if the user specified a path, try that first
++AC_ARG_WITH(mount,
++ [ --with-mount=PATH Specify the path to mount ],
++ [
++ if test "x$withval" != "xno"; then
++ if test -x "$withval"; then
++ MOUNT=$withval
++ else
++ AC_MSG_ERROR(mount not found)
++ fi
++ else
++ MOUNT=no
++ fi
++ ]
++)
++dnl save the program for testing
++AC_SUBST(TEST_MOUNT, "$MOUNT")
++dnl if the user didn't specify a path, hunt for it
++if test "$MOUNT" != "no"; then
++ if test "$MOUNT" = ""; then
++ AC_PATH_PROG(MOUNT, mount, no)
++ fi
++fi
++dnl if we couldn't find it, provide an example
++if test "$MOUNT" = "no"; then
++ MOUNT=/bin/mount
++fi
++dnl either way, set the cmd_mount var
++AC_SUBST(CMD_MOUNT, "cnux_lvm_cmd_mount $MOUNT")
++
++dnl
++dnl UMOUNT CHECK (optional program)
++dnl
++dnl if the user specified a path, try that first
++AC_ARG_WITH(umount,
++ [ --with-umount=PATH Specify the path to umount ],
++ [
++ if test "x$withval" != "xno"; then
++ if test -x "$withval"; then
++ UMOUNT=$withval
++ else
++ AC_MSG_ERROR(umount not found)
++ fi
++ else
++ UMOUNT=no
++ fi
++ ]
++)
++dnl save the program for testing
++AC_SUBST(TEST_UMOUNT, "$UMOUNT")
++dnl if the user didn't specify a path, hunt for it
++if test "$UMOUNT" != "no"; then
++ if test "$UMOUNT" = ""; then
++ AC_PATH_PROG(UMOUNT, umount, no)
++ fi
++fi
++dnl if we couldn't find it, provide an example
++if test "$UMOUNT" = "no"; then
++ UMOUNT=/bin/umount
++fi
++dnl either way, set the cmd_umount var
++AC_SUBST(CMD_UMOUNT, "linux_lvm_cmd_umount $UMOUNT")
++
++dnl
++dnl KPARTX CHECK (optional program)
++dnl
++dnl if the user specified a path, try that first
++AC_ARG_WITH(kpartx,
++ [ --with-kpartx=PATH Specify the path to kpartx ],
++ [
++ if test "x$withval" != "xno"; then
++ if test -x "$withval"; then
++ KPARTX=$withval
++ else
++ AC_MSG_ERROR(kpartx not found)
++ fi
++ else
++ KPARTX=no
++ fi
++ ]
++)
++dnl save the program for testing
++AC_SUBST(TEST_KPARTX, "$KPARTX")
++dnl if the user didn't specify a path, hunt for it
++if test "$KPARTX" != "no"; then
++ if test "$KPARTX" = ""; then
++ AC_PATH_PROG(KPARTX, kpartx, no)
++ fi
++fi
++dnl if we couldn't find it, provide an example
++if test "$KPARTX" = "no"; then
++ KPARTX=/sbin/kpartx
++fi
++dnl either way, set the cmd_kpartx var
++AC_SUBST(CMD_KPARTX, "linux_lvm_cmd_kpartx $KPARTX")
+
+ dnl Combine the preamble with a normal, working script
+ AC_CONFIG_FILES(rsnapshot:rsnapshot-preamble.pl:rsnapshot-program.pl)
|
[-]
[+]
|
Added |
rsnapshot-include_dir.patch
^
|
@@ -0,0 +1,24 @@
+--- rsnapshot-program.pl.orig 2011-11-07 10:08:54.000000000 +0100
++++ rsnapshot-program.pl 2011-11-07 11:05:51.000000000 +0100
+@@ -581,7 +581,20 @@
+ next;
+ }
+ }
+-
++ # INCLUDE dir
++ if($var eq 'include_dir') {
++ opendir(DIR, $value) or bail("Could not open $value");
++ foreach ( sort grep(/^.*\.conf$/,readdir(DIR)) ) {
++ my $file = $value . "/" . $_;
++ if ( -f $file && -r $file ) {
++ $line_syntax_ok = 1;
++ parse_config_file($file);
++ } else {
++ config_err($file_line_num, "$line - can't find or read file '$file'");
++ next;
++ }
++ }
++ }
+ # CONFIG_VERSION
+ if ($var eq 'config_version') {
+ if (defined($value)) {
|
[-]
[+]
|
Added |
rsnapshot-kpartx-lvm.patch
^
|
@@ -0,0 +1,258 @@
+--- rsnapshot-program.pl.orig 2008-09-14 21:21:21.000000000 +0300
++++ rsnapshot-program.pl 2009-11-12 12:43:28.000000000 +0200
+@@ -163,6 +163,9 @@
+ my $default_ssh_args = undef;
+ my $default_du_args = '-csh';
+
++# set default for acl_mount
++my $acl_mount = 0;
++
+ # set default for use_lazy_deletes
+ my $use_lazy_deletes = 0; # do not delete the oldest archive until after backup
+
+@@ -801,7 +804,18 @@
+ next;
+ }
+ }
+-
++ # CHECK FOR kpartx (optional)
++ if ($var eq 'linux_lvm_cmd_kpartx') {
++ if ((-f "$value") && (-x "$value") && (1 == is_real_local_abs_path($value))) {
++ $config_vars{'linux_lvm_cmd_kpartx'} = $value;
++ $line_syntax_ok = 1;
++ next;
++ } else {
++ config_err($file_line_num, "$line - $value is not executable");
++ next;
++ }
++ }
++
+ # CHECK FOR cmd_preexec (optional)
+ if ($var eq 'cmd_preexec') {
+ my $script; # script file (no args)
+@@ -965,7 +979,7 @@
+ $line_syntax_ok = 1;
+
+ # check for lvm
+- } elsif ( is_linux_lvm_path($src) ) {
++ } elsif ( my $return_val = is_linux_lvm_path($src) ) {
+ # if it's an lvm path, make sure we have lvm commands and arguments
+ if (!defined($config_vars{'linux_lvm_cmd_lvcreate'})) {
+ config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_lvcreate not defined in $config_file");
+@@ -983,6 +997,10 @@
+ config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_umount not defined in $config_file");
+ next;
+ }
++ if ($return_val == 2 and !defined($config_vars{'linux_lvm_cmd_kpartx'})) {
++ config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_kpartx not defined in $config_file");
++ next;
++ }
+ if (!defined($config_vars{'linux_lvm_snapshotsize'})) {
+ config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_snapshotsize not defined in $config_file");
+ next;
+@@ -1216,6 +1234,23 @@
+ $line_syntax_ok = 1;
+ next;
+ }
++ # ACL_MOUNT
++ if ($var eq 'acl_mount') {
++ if (!defined($value)) {
++ config_err($file_line_num, "$line - acl_mount can not be blank");
++ next;
++ }
++ if (!is_boolean($value)) {
++ config_err(
++ $file_line_num, "$line - \"$value\" is not a legal value for acl_mount, must be 0 or 1 only"
++ );
++ next;
++ }
++
++ $acl_mount = $value;
++ $line_syntax_ok = 1;
++ next;
++ }
+ # LOCKFILE
+ if ($var eq 'lockfile') {
+ if (!defined($value)) { config_err($file_line_num, "$line - lockfile can not be blank"); }
+@@ -1713,6 +1748,11 @@
+ if (!is_boolean($parsed_opts{'one_fs'})) {
+ return (undef);
+ }
++ # acl_mount
++ } elsif ( $name eq 'acl_mount' ) {
++ if (!is_boolean($parsed_opts{'acl_mount'})) {
++ return (undef);
++ }
+ # rsync_short_args
+ } elsif ( $name eq 'rsync_short_args' ) {
+ # must be in the format '-abcde'
+@@ -2702,12 +2742,13 @@
+ # returns 1 if it's a syntactically valid LVM path
+ # returns 0 otherwise
+ sub is_linux_lvm_path {
+- my $path = shift(@_);
+-
+- if (!defined($path)) { return (undef); }
+- if ($path =~ m|^lvm://.*$|) { return (1); }
+-
+- return (0);
++ my $path = shift(@_);
++
++ if (!defined($path)) { return (undef); }
++ if ($path =~ m|^lvm://.*$|) { return (1);
++ } elsif ($path =~ m|^lvm-kpartx://.*$|) { return (2); }
++
++ return (0);
+ }
+
+ # accepts proposed list for rsync_short_args
+@@ -3313,8 +3354,10 @@
+ my $using_relative = 0;
+
+ my $linux_lvm = 0;
++ my $linux_lvm_mountopts = undef;
+ my $linux_lvm_oldpwd = undef;
+ my $linux_lvm_snapshotname = undef;
++ my $linux_lvm_kpartx = undef;
+
+ if (defined($$bp_ref{'src'})) {
+ $src = remove_trailing_slash( "$$bp_ref{'src'}" );
+@@ -3444,7 +3487,15 @@
+ } elsif ($one_fs) {
+ $rsync_short_args .= 'x';
+ }
+-
++ # ACL_MOUNT
++ if ( defined($$bp_ref{'opts'}) && defined($$bp_ref{'opts'}->{'acl_mount'}) ) {
++ if (1 == $$bp_ref{'opts'}->{'acl_mount'}) {
++ $linux_lvm_mountopts .= ',acl';
++ }
++ } elsif ($acl_mount) {
++ $linux_lvm_mountopts .= ',acl';
++ }
++
+ # SEE WHAT KIND OF SOURCE WE'RE DEALING WITH
+ #
+ # local filesystem
+@@ -3474,7 +3525,7 @@
+ if ($verbose < 2) { $rsync_short_args .= 'q'; }
+
+ # LVM path
+- } elsif ( is_linux_lvm_path($$bp_ref{'src'}) ) {
++ } elsif ( my $return_value = is_linux_lvm_path($$bp_ref{'src'}) ) {
+ # take LVM snapshot and mount, reformat src into local path
+
+ unless (defined($config_vars{'linux_lvm_snapshotsize'})) {
+@@ -3490,13 +3541,23 @@
+ bail("Missing required argument for LVM source: linux_lvm_mountpath");
+ }
+
+- # parse LVM src ('lvm://vgname/volname/path')
+- my ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm://([^/]+)/([^/]+)/(.*)$|);
+- # lvmvolname and/or path could be the string "0", so test for 'defined':
+- unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpath)) {
+- bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
+- }
+-
++ my ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpartnum, $linux_lvmpath);
++ if ($return_value == 2) {
++ # parse LVM src {'lvm-kpartx://vgname/volname/partnum/path'}
++ ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpartnum, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm-kpartx://([^/]+)/([^/]+)/(\d+)/(.*)$|);
++ # lvmvolname and/or path could be the string "0", so test for 'defined':
++ unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpartnum) and defined($linux_lvmpath)) {
++ bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
++ }
++ } else {
++ # parse LVM src ('lvm://vgname/volname/path')
++ ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm://([^/]+)/([^/]+)/(.*)$|);
++ # lvmvolname and/or path could be the string "0", so test for 'defined':
++ unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpath)) {
++ bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
++ }
++ }
++
+ # assemble and execute LVM snapshot command
+ @cmd_stack = ();
+ push(@cmd_stack, $config_vars{'linux_lvm_cmd_lvcreate'});
+@@ -3520,12 +3581,35 @@
+ }
+ }
+
++ $linux_lvm_snapshotname = join('/', $config_vars{'linux_lvm_vgpath'}, $linux_lvmvgname, $config_vars{'linux_lvm_snapshotname'});
++ # kpartx add snapshot
++ if ($return_value == 2) {
++ @cmd_stack = ();
++ #static kpartx args
++ my $kpartx_add_args = '-ap_';
++ push(@cmd_stack, $config_vars{'linux_lvm_cmd_kpartx'});
++ push(@cmd_stack, $kpartx_add_args);
++ push (@cmd_stack, $linux_lvm_snapshotname);
++ print_cmd(@cmd_stack);
++ if (0 == $test) {
++ $result = system(@cmd_stack);
++ if ($result != 0) {
++ bail("Kpartx add for LVM snapshot failed: $result");
++ }
++ }
++
++ }
++
|
[-]
[+]
|
Deleted |
rsnapshot-kpartx.patch
^
|
@@ -1,257 +0,0 @@
---- ./rsnapshot.orig 2008-10-30 19:54:10.000000000 +0200
-+++ rsnapshot 2008-11-03 15:28:07.000000000 +0200
-@@ -163,6 +163,9 @@
- my $default_ssh_args = undef;
- my $default_du_args = '-csh';
-
-+# set default for acl_mount
-+my $acl_mount = 0;
-+
- # set default for use_lazy_deletes
- my $use_lazy_deletes = 0; # do not delete the oldest archive until after backup
-
-@@ -801,7 +804,18 @@
- next;
- }
- }
--
-+ # CHECK FOR kpartx (optional)
-+ if ($var eq 'linux_lvm_cmd_kpartx') {
-+ if ((-f "$value") && (-x "$value") && (1 == is_real_local_abs_path($value))) {
-+ $config_vars{'linux_lvm_cmd_kpartx'} = $value;
-+ $line_syntax_ok = 1;
-+ next;
-+ } else {
-+ config_err($file_line_num, "$line - $value is not executable");
-+ next;
-+ }
-+ }
-+
- # CHECK FOR cmd_preexec (optional)
- if ($var eq 'cmd_preexec') {
- my $script; # script file (no args)
-@@ -965,7 +979,7 @@
- $line_syntax_ok = 1;
-
- # check for lvm
-- } elsif ( is_linux_lvm_path($src) ) {
-+ } elsif ( my $return_val = is_linux_lvm_path($src) ) {
- # if it's an lvm path, make sure we have lvm commands and arguments
- if (!defined($config_vars{'linux_lvm_cmd_lvcreate'})) {
- config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_lvcreate not defined in $config_file");
-@@ -983,6 +997,10 @@
- config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_umount not defined in $config_file");
- next;
- }
-+ if ($return_val == 2 and !defined($config_vars{'linux_lvm_cmd_kpartx'})) {
-+ config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_cmd_kpartx not defined in $config_file");
-+ next;
-+ }
- if (!defined($config_vars{'linux_lvm_snapshotsize'})) {
- config_err($file_line_num, "$line - Cannot handle $src, linux_lvm_snapshotsize not defined in $config_file");
- next;
-@@ -1216,6 +1234,23 @@
- $line_syntax_ok = 1;
- next;
- }
-+ # ACL_MOUNT
-+ if ($var eq 'acl_mount') {
-+ if (!defined($value)) {
-+ config_err($file_line_num, "$line - acl_mount can not be blank");
-+ next;
-+ }
-+ if (!is_boolean($value)) {
-+ config_err(
-+ $file_line_num, "$line - \"$value\" is not a legal value for acl_mount, must be 0 or 1 only"
-+ );
-+ next;
-+ }
-+
-+ $acl_mount = $value;
-+ $line_syntax_ok = 1;
-+ next;
-+ }
- # LOCKFILE
- if ($var eq 'lockfile') {
- if (!defined($value)) { config_err($file_line_num, "$line - lockfile can not be blank"); }
-@@ -1713,6 +1748,11 @@
- if (!is_boolean($parsed_opts{'one_fs'})) {
- return (undef);
- }
-+ # acl_mount
-+ } elsif ( $name eq 'acl_mount' ) {
-+ if (!is_boolean($parsed_opts{'acl_mount'})) {
-+ return (undef);
-+ }
- # rsync_short_args
- } elsif ( $name eq 'rsync_short_args' ) {
- # must be in the format '-abcde'
-@@ -2702,12 +2742,13 @@
- # returns 1 if it's a syntactically valid LVM path
- # returns 0 otherwise
- sub is_linux_lvm_path {
-- my $path = shift(@_);
--
-- if (!defined($path)) { return (undef); }
-- if ($path =~ m|^lvm://.*$|) { return (1); }
--
-- return (0);
-+ my $path = shift(@_);
-+
-+ if (!defined($path)) { return (undef); }
-+ if ($path =~ m|^lvm://.*$|) { return (1);
-+ } elsif ($path =~ m|^lvm-kpartx://.*$|) { return (2); }
-+
-+ return (0);
- }
-
- # accepts proposed list for rsync_short_args
-@@ -3313,8 +3354,10 @@
- my $using_relative = 0;
-
- my $linux_lvm = 0;
-+ my $linux_lvm_mountopts = undef;
- my $linux_lvm_oldpwd = undef;
- my $linux_lvm_snapshotname = undef;
-+ my $linux_lvm_kpartx = undef;
-
- if (defined($$bp_ref{'src'})) {
- $src = remove_trailing_slash( "$$bp_ref{'src'}" );
-@@ -3444,7 +3487,15 @@
- } elsif ($one_fs) {
- $rsync_short_args .= 'x';
- }
--
-+ # ACL_MOUNT
-+ if ( defined($$bp_ref{'opts'}) && defined($$bp_ref{'opts'}->{'acl_mount'}) ) {
-+ if (1 == $$bp_ref{'opts'}->{'acl_mount'}) {
-+ $linux_lvm_mountopts .= ',acl';
-+ }
-+ } elsif ($acl_mount) {
-+ $linux_lvm_mountopts .= ',acl';
-+ }
-+
- # SEE WHAT KIND OF SOURCE WE'RE DEALING WITH
- #
- # local filesystem
-@@ -3474,7 +3525,7 @@
- if ($verbose < 2) { $rsync_short_args .= 'q'; }
-
- # LVM path
-- } elsif ( is_linux_lvm_path($$bp_ref{'src'}) ) {
-+ } elsif ( my $return_value = is_linux_lvm_path($$bp_ref{'src'}) ) {
- # take LVM snapshot and mount, reformat src into local path
-
- unless (defined($config_vars{'linux_lvm_snapshotsize'})) {
-@@ -3490,13 +3541,23 @@
- bail("Missing required argument for LVM source: linux_lvm_mountpath");
- }
-
-- # parse LVM src ('lvm://vgname/volname/path')
-- my ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm://([^/]+)/([^/]+)/(.*)$|);
-- # lvmvolname and/or path could be the string "0", so test for 'defined':
-- unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpath)) {
-- bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
-- }
--
-+ my ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpartnum, $linux_lvmpath);
-+ if ($return_value == 2) {
-+ # parse LVM src {'lvm-kpartx://vgname/volname/partnum/path'}
-+ ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpartnum, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm-kpartx://([^/]+)/([^/]+)/(\d+)/(.*)$|);
-+ # lvmvolname and/or path could be the string "0", so test for 'defined':
-+ unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpartnum) and defined($linux_lvmpath)) {
-+ bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
-+ }
-+ } else {
-+ # parse LVM src ('lvm://vgname/volname/path')
-+ ($linux_lvmvgname,$linux_lvmvolname, $linux_lvmpath) = ($$bp_ref{'src'} =~ m|^lvm://([^/]+)/([^/]+)/(.*)$|);
-+ # lvmvolname and/or path could be the string "0", so test for 'defined':
-+ unless (defined($linux_lvmvgname) and defined($linux_lvmvolname) and defined($linux_lvmpath)) {
-+ bail("Could not understand LVM source \"$$bp_ref{'src'}\" in backup_lowest_interval()");
-+ }
-+ }
-+
- # assemble and execute LVM snapshot command
- @cmd_stack = ();
- push(@cmd_stack, $config_vars{'linux_lvm_cmd_lvcreate'});
-@@ -3520,12 +3581,35 @@
- }
- }
-
-+ $linux_lvm_snapshotname = join('/', $config_vars{'linux_lvm_vgpath'}, $linux_lvmvgname, $config_vars{'linux_lvm_snapshotname'});
-+ # kpartx add snapshot
-+ if ($return_value == 2) {
-+ @cmd_stack = ();
-+ #static kpartx args
-+ my $kpartx_add_args = '-ap_';
-+ push(@cmd_stack, $config_vars{'linux_lvm_cmd_kpartx'});
-+ push(@cmd_stack, $kpartx_add_args);
-+ push (@cmd_stack, $linux_lvm_snapshotname);
-+ print_cmd(@cmd_stack);
-+ if (0 == $test) {
-+ $result = system(@cmd_stack);
-+ if ($result != 0) {
-+ bail("Kpartx add for LVM snapshot failed: $result");
-+ }
-+ }
-+
-+ }
-+
|
[-]
[+]
|
Changed |
rsnapshot.patch
^
|
@@ -1,5 +1,5 @@
---- rsnapshot.conf.default.in 2008-04-27 20:26:16.000000000 +1000
-+++ rsnapshot.conf.default.in.redhat 2008-08-31 21:23:43.000000000 +1000
+--- rsnapshot.conf.default.in.orig 2011-11-07 11:32:58.521039582 +0100
++++ rsnapshot.conf.default.in 2011-11-07 12:05:42.512262092 +0100
@@ -41,7 +41,7 @@
#
# See the README file or the man page for more details.
@@ -23,7 +23,20 @@
# Specify the path to a script (and any optional arguments) to run right
# before rsnapshot syncs files
-@@ -113,7 +113,7 @@
+@@ -80,6 +80,12 @@
+ #
+ #cmd_postexec /path/to/postexec/script
+
++@CMD_LVCREATE@
++@CMD_LVREMOVE@
++@CMD_MOUNT@
++@CMD_UMOUNT@
++@CMD_KPARTX@
++
+ #########################################
+ # BACKUP INTERVALS #
+ # Must be unique and in ascending order #
+@@ -113,7 +119,7 @@
# If you enable this, data will be written to the file you specify. The
# amount of data written is controlled by the "loglevel" parameter.
#
@@ -32,3 +45,30 @@
# If enabled, rsnapshot will write a lockfile to prevent two instances
# from running simultaneously (and messing up the snapshot_root).
+@@ -181,6 +187,11 @@
+ #
+ #use_lazy_deletes 0
+
++linux_lvm_snapshotsize 1G
++linux_lvm_snapshotname rsnapshot
++linux_lvm_vgpath /dev
++linux_lvm_mountpath /var/backups/lvm-snapshot
++
+ # Number of rsync re-tries. If you experience any network problems or
+ # network card issues that tend to cause ssh to crap-out with
+ # "Corrupted MAC on input" errors, for example, set this to a non-zero
+@@ -216,3 +227,14 @@
+ # RSYNC.SAMBA.ORG
+ #backup rsync://rsync.samba.org/rsyncftp/ rsync.samba.org/rsyncftp/
+
++# lvm examples
++#backup lvm-kpartx://vg0/server1/1/ server1/ rsync_long_args=--no-D --delete --numeric-ids --delete-excluded, rsync_short_args=-aAHq,exclude=**/var/spool/squid/*
++#backup lvm-kpartx://vg0/server1/2/ server1/var/log/
++#
++#backup lvm://vg0/root_telexen/ root/ one_fs=1
++#backup lvm://vg0/varlog_telexen/ root/var/log/
++#backup /boot/ root/
++##backup lvm://vg0/ubimage_dev/ ubimage_dev/ rsync_short_args=-aAHq, one_fs=1, acl_mount=1
++#
++#backup lvm-kpartx://vg0/vpsgateway/1/ vpsgateway/ rsync_short_args=-aAHq, one_fs=1, acl_mount=1
++
|
[-]
[+]
|
Deleted |
rsnapshot-kpartx-params.conf
^
|
@@ -1,22 +0,0 @@
-# If this is enabled, LVM snapshots will be mounted with '-o acl'.
-# The default is 0 (off).
-#
-#acl_mount 0
-
-linux_lvm_cmd_kpartx /sbin/kpartx
-
-# LV with partitions on top of it , syntax :
-
-# lvm-kpartx://VolumeGroup/LogicalVolume/PartitionNumber/Path/
-
-# Creates snapshot of /dev/vg0/server and mounts with option "-o acl" the
-# first partition on the new logical volume snapshot.
-#backup lvm-kpartx://vg0/server/1/var/cache/ server/
-
-# Creates snapshot of /dev/vg0/Logvol01 and mounts with option "-o acl"
-# the second partition on the new logical volume snapshot.
-#backup lvm-kpartx://vg0/Logvol01/2/ Logvol01/var/log/ acl_mount=1
-
-# Creates snapshot of /dev/vg0/nfsimage mounts with option "-o acl"
-#backup lvm://vg0/nfsimage/ nfsimage/ rsync_short_args=-aAHq, one_fs=1, acl_mount=1
-
|