Add properties flag for including the properties in the send stream.
With the flag, we do not break the current behavior and give the user
who like to sync their properties the possibility to do so.
Signed-off-by: Wolfgang Link <w.link@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
method => undef,
source_user => undef,
dest_user => undef,
method => undef,
source_user => undef,
dest_user => undef,
};
my ($ret) = GetOptionsFromArray(
};
my ($ret) = GetOptionsFromArray(
'skip' => \$param->{skip},
'method=s' => \$param->{method},
'source-user=s' => \$param->{source_user},
'skip' => \$param->{skip},
'method=s' => \$param->{method},
'source-user=s' => \$param->{source_user},
- 'dest-user=s' => \$param->{dest_user}
+ 'dest-user=s' => \$param->{dest_user},
+ 'properties' => \$param->{properties},
);
die "can't parse options\n" if $ret == 0;
);
die "can't parse options\n" if $ret == 0;
$job->{source} = $param->{source};
$job->{source_user} = $param->{source_user};
$job->{dest_user} = $param->{dest_user};
$job->{source} = $param->{source};
$job->{source_user} = $param->{source_user};
$job->{dest_user} = $param->{dest_user};
+ $job->{properties} = $param->{properties} ? $param->{properties} : 0;
$text .= " --verbose" if $job->{verbose};
$text .= " --source-user $job->{source_user}";
$text .= " --dest-user $job->{dest_user}";
$text .= " --verbose" if $job->{verbose};
$text .= " --source-user $job->{source_user}";
$text .= " --dest-user $job->{dest_user}";
+ $text .= " --properties $job->{properties}" if $job->{properties};
$text .= "\n";
return $text;
$text .= "\n";
return $text;
push @$cmd, 'ssh', '-o', 'BatchMode=yes', "$param->{source_user}\@$source->{ip}", '--' if $source->{ip};
push @$cmd, 'zfs', 'send';
push @$cmd, 'ssh', '-o', 'BatchMode=yes', "$param->{source_user}\@$source->{ip}", '--' if $source->{ip};
push @$cmd, 'zfs', 'send';
+ push @$cmd, '-p', if $param->{properties};
push @$cmd, '-v' if $param->{verbose};
if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{dest_user})) {
push @$cmd, '-v' if $param->{verbose};
if($source->{last_snap} && snapshot_exist($source , $dest, $param->{method}, $param->{dest_user})) {
-source-user string
name of the user on the source target, root by default
-source-user string
name of the user on the source target, root by default
+
+ -properties boolean
+
+ Include the dataset's properties in the stream.
},
sync => qq{
$PROGNAME sync -dest <string> -source <string> [OPTIONS]\n
},
sync => qq{
$PROGNAME sync -dest <string> -source <string> [OPTIONS]\n
-verbose boolean
print out the sync progress.
-verbose boolean
print out the sync progress.
+
+ -properties boolean
+
+ Include the dataset's properties in the stream.
},
list => qq{
$PROGNAME list
},
list => qq{
$PROGNAME list