mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Allow zfs to send replication streams with missing snapshots
A tentative implementation and discussion was done in #5285. According to it a send --skip-missing|-s flag has been added. In a replication stream, when there are snapshots missing in the hierarchy, if -s is provided print a warning and ignore dataset (and its children) instead of throwing an error Reviewed-by: Paul Dagnelie <pcd@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Pablo Correa Gómez <ablocorrea@hotmail.com> Closes #11710
This commit is contained in:
+12
-1
@@ -4376,6 +4376,7 @@ zfs_do_send(int argc, char **argv)
|
||||
|
||||
struct option long_options[] = {
|
||||
{"replicate", no_argument, NULL, 'R'},
|
||||
{"skip-missing", no_argument, NULL, 's'},
|
||||
{"redact", required_argument, NULL, 'd'},
|
||||
{"props", no_argument, NULL, 'p'},
|
||||
{"parsable", no_argument, NULL, 'P'},
|
||||
@@ -4394,7 +4395,7 @@ zfs_do_send(int argc, char **argv)
|
||||
};
|
||||
|
||||
/* check options */
|
||||
while ((c = getopt_long(argc, argv, ":i:I:RDpvnPLeht:cwbd:S",
|
||||
while ((c = getopt_long(argc, argv, ":i:I:RsDpvnPLeht:cwbd:S",
|
||||
long_options, NULL)) != -1) {
|
||||
switch (c) {
|
||||
case 'i':
|
||||
@@ -4411,6 +4412,9 @@ zfs_do_send(int argc, char **argv)
|
||||
case 'R':
|
||||
flags.replicate = B_TRUE;
|
||||
break;
|
||||
case 's':
|
||||
flags.skipmissing = B_TRUE;
|
||||
break;
|
||||
case 'd':
|
||||
redactbook = optarg;
|
||||
break;
|
||||
@@ -4575,6 +4579,13 @@ zfs_do_send(int argc, char **argv)
|
||||
resume_token));
|
||||
}
|
||||
|
||||
if (flags.skipmissing && !flags.replicate) {
|
||||
(void) fprintf(stderr,
|
||||
gettext("skip-missing flag can only be used in "
|
||||
"conjunction with replicate\n"));
|
||||
usage(B_FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* For everything except -R and -I, use the new, cleaner code path.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user