correctly parse zfs column output (space can be included in the values)
This commit is contained in:
parent
9d387c013f
commit
34b942ea45
2
sanoid
2
sanoid
|
@ -521,7 +521,7 @@ sub getsnaps {
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach my $snap (@rawsnaps) {
|
foreach my $snap (@rawsnaps) {
|
||||||
my ($fs,$snapname,$snapdate) = ($snap =~ m/(.*)\@(.*ly)\s*creation\s*(\d*)/);
|
my ($fs,$snapname,$snapdate) = ($snap =~ m/(.*)\@(.*ly)\t*creation\t*(\d*)/);
|
||||||
|
|
||||||
# avoid pissing off use warnings
|
# avoid pissing off use warnings
|
||||||
if (defined $snapname) {
|
if (defined $snapname) {
|
||||||
|
|
10
syncoid
10
syncoid
|
@ -664,7 +664,7 @@ sub getzfsvalue {
|
||||||
open FH, "$rhost $mysudocmd $zfscmd get -H $property $fsescaped |";
|
open FH, "$rhost $mysudocmd $zfscmd get -H $property $fsescaped |";
|
||||||
my $value = <FH>;
|
my $value = <FH>;
|
||||||
close FH;
|
close FH;
|
||||||
my @values = split(/\s/,$value);
|
my @values = split(/\t/,$value);
|
||||||
$value = $values[2];
|
$value = $values[2];
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
@ -985,7 +985,7 @@ sub getsnaps() {
|
||||||
if ($line =~ /\Q$fs\E\@.*guid/) {
|
if ($line =~ /\Q$fs\E\@.*guid/) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
my $guid = $line;
|
my $guid = $line;
|
||||||
$guid =~ s/^.*\sguid\s*(\d*).*/$1/;
|
$guid =~ s/^.*\tguid\t*(\d*).*/$1/;
|
||||||
my $snap = $line;
|
my $snap = $line;
|
||||||
$snap =~ s/^.*\@(.*)\tguid.*$/$1/;
|
$snap =~ s/^.*\@(.*)\tguid.*$/$1/;
|
||||||
$snaps{$type}{$snap}{'guid'}=$guid;
|
$snaps{$type}{$snap}{'guid'}=$guid;
|
||||||
|
@ -997,7 +997,7 @@ sub getsnaps() {
|
||||||
if ($line =~ /\Q$fs\E\@.*creation/) {
|
if ($line =~ /\Q$fs\E\@.*creation/) {
|
||||||
chomp $line;
|
chomp $line;
|
||||||
my $creation = $line;
|
my $creation = $line;
|
||||||
$creation =~ s/^.*\screation\s*(\d*).*/$1/;
|
$creation =~ s/^.*\tcreation\t*(\d*).*/$1/;
|
||||||
my $snap = $line;
|
my $snap = $line;
|
||||||
$snap =~ s/^.*\@(.*)\tcreation.*$/$1/;
|
$snap =~ s/^.*\@(.*)\tcreation.*$/$1/;
|
||||||
$snaps{$type}{$snap}{'creation'}=$creation;
|
$snaps{$type}{$snap}{'creation'}=$creation;
|
||||||
|
@ -1056,9 +1056,9 @@ sub getsendsize {
|
||||||
# the output format is different in case of
|
# the output format is different in case of
|
||||||
# a resumed receive
|
# a resumed receive
|
||||||
if (defined($receivetoken)) {
|
if (defined($receivetoken)) {
|
||||||
$sendsize =~ s/.*\s([0-9]+)$/$1/;
|
$sendsize =~ s/.*\t([0-9]+)$/$1/;
|
||||||
} else {
|
} else {
|
||||||
$sendsize =~ s/^size\s*//;
|
$sendsize =~ s/^size\t*//;
|
||||||
}
|
}
|
||||||
chomp $sendsize;
|
chomp $sendsize;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue