Permalink
Browse files

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

  • Loading branch information...
jimsalterjrs
jimsalterjrs committed Sep 14, 2017
1 parent d135ee0 commit 34e4c248bce29103a3f62a08246bc0d51aee23b8
Showing with 8 additions and 4 deletions.
  1. +4 −0 CHANGELIST
  2. +1 −1 VERSION
  3. +3 −3 sanoid
View
@@ -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
@@ -1 +1 @@
1.4.16
1.4.17
View
6 sanoid
@@ -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;
}

0 comments on commit 34e4c24

Please sign in to comment.