change die to warn when sanoid can't remove a snap

This commit is contained in:
jimsalterjrs 2017-09-14 09:58:03 -04:00
parent d135ee0dc8
commit 34e4c248bc
3 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
1.4.17 changed die to warn when unexpectedly unable to remove a snapshot - this
allows sanoid to continue taking/removing other snapshots not affected by
whatever lock prevented the first from being taken or removed
1.4.16 merged @hrast01's extended fix to support -o option1=val,option2=val passthrough to SSH. merged @JakobR's
off-by-one fix to stop unnecessary extra snapshots being taken under certain conditions. merged @stardude900's
update to INSTALL for FreeBSD users re:symlinks. Implemented @LordAro's update to change DIE to WARN when

View File

@ -1 +1 @@
1.4.16
1.4.17

6
sanoid
View File

@ -4,7 +4,7 @@
# from http://www.gnu.org/licenses/gpl-3.0.html on 2014-11-17. A copy should also be available in this
# project's Git repository at https://github.com/jimsalterjrs/sanoid/blob/master/LICENSE.
my $version = '1.4.16';
my $version = '1.4.17';
use strict;
use Config::IniFiles; # read samba-style conf file
@ -224,7 +224,7 @@ sub prune_snapshots {
if (iszfsbusy($path)) {
print "INFO: deferring pruning of $snap - $path is currently in zfs send or receive.\n";
} else {
if (! $args{'readonly'}) { system($zfs, "destroy",$snap) == 0 or die "could not remove $snap : $?"; }
if (! $args{'readonly'}) { system($zfs, "destroy",$snap) == 0 or warn "could not remove $snap : $?"; }
}
}
removelock('sanoid_pruning');
@ -333,7 +333,7 @@ sub take_snapshots {
if ($args{'verbose'}) { print "taking snapshot $snap\n"; }
if (!$args{'readonly'}) {
system($zfs, "snapshot", "$snap") == 0
or die "CRITICAL ERROR: $zfs snapshot $snap failed, $?";
or warn "CRITICAL ERROR: $zfs snapshot $snap failed, $?";
# make sure we don't end up with multiple snapshots with the same ctime
sleep 1;
}