Compare commits

..

1 Commits

Author SHA1 Message Date
Пётр 952dde6801
Merge f70a961d79 into 940a84e21f 2025-06-16 22:39:22 -05:00
2 changed files with 9 additions and 8 deletions

15
sanoid
View File

@ -1084,9 +1084,11 @@ sub init {
@datasets = getchilddatasets($config{$section}{'path'});
DATASETS: foreach my $dataset(@datasets) {
if (! @cachedatasets) {
push (@updatedatasets, "$dataset\n");
push (@updatedatasets, $dataset);
}
chomp $dataset;
if ($zfsRecursive) {
# don't try to take the snapshot ourself, recursive zfs snapshot will take care of that
$config{$dataset}{'autosnap'} = 0;
@ -1689,7 +1691,7 @@ sub getchilddatasets {
my $getchildrencmd = "$mysudocmd $zfs list -o name -t filesystem,volume -Hr $fs |";
if ($args{'debug'}) { print "DEBUG: getting list of child datasets on $fs using $getchildrencmd...\n"; }
open FH, $getchildrencmd;
chomp( my @children = <FH> );
my @children = <FH>;
close FH;
# parent dataset is the first element
@ -1779,26 +1781,25 @@ sub addcachedsnapshots {
copy($cache, "$cache.tmp") or die "Could not copy to $cache.tmp!\n";
open my $fh, ">> $cache.tmp" or die "Could not write to $cache.tmp!\n";
open FH, ">> $cache.tmp" or die "Could not write to $cache.tmp!\n";
while((my $snap, my $details) = each(%taken)) {
my @parts = split("@", $snap, 2);
my $suffix = $parts[1] . "\tcreation\t" . $details->{time} . "\t-";
my $dataset = $parts[0];
print $fh "${dataset}\@${suffix}\n";
print FH "${dataset}\@${suffix}\n";
if ($details->{recursive}) {
my @datasets = getchilddatasets($dataset);
foreach my $dataset(@datasets) {
print "${dataset}\@${suffix}\n";
print $fh "${dataset}\@${suffix}\n";
print FH "${dataset}\@${suffix}\n";
}
}
}
close $fh;
close FH;
# preserve mtime of cache for expire check
my ($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime, $ctime, $blksize, $blocks) = stat($cache);

View File

@ -184,7 +184,7 @@ if (length $args{'insecure-direct-connection'}) {
$directlisten = $args{'insecure-direct-connection'};
}
if (scalar @parts >= 3) {
if (scalar @parts == 3) {
$directtimeout = $parts[2];
}