]> git.proxmox.com Git - proxmox-backup.git/blobdiff - src/bin/proxmox-backup-client.rs
src/bin/proxmox-backup-client.rs: add restore flag --allow-existing-dirs
[proxmox-backup.git] / src / bin / proxmox-backup-client.rs
index 2fa5cb080bebc107f0b83a5f2c6d0a5d04cb8844..1b0133bf5a5c24966ad8cdd1950a45da7b0d6a2a 100644 (file)
@@ -641,6 +641,8 @@ fn restore(
 
     let verbose = param["verbose"].as_bool().unwrap_or(false);
 
+    let allow_existing_dirs = param["allow-existing-dirs"].as_bool().unwrap_or(false);
+
     let archive_name = tools::required_string_param(&param, "archive-name")?;
 
     let client = HttpClient::new(repo.host(), repo.user())?;
@@ -737,6 +739,10 @@ fn restore(
 
         if let Some(target) = target {
 
+            if allow_existing_dirs {
+                unimplemented!();
+            }
+
             let feature_flags = pxar::CA_FORMAT_DEFAULT;
             let mut decoder = pxar::SequentialDecoder::new(&mut reader, feature_flags, |path| {
                 if verbose {
@@ -1429,6 +1435,9 @@ We do not extraxt '.pxar' archives when writing to stdandard output.
 
 "###
                 ))
+                .optional(
+                    "allow-existing-dirs",
+                    BooleanSchema::new("Do not fail if directories already exists.").default(false))
                 .optional("repository", REPO_URL_SCHEMA.clone())
                 .optional("keyfile", StringSchema::new("Path to encryption key."))
                 .optional(