Bugfix/disk info (#770)

* use df for getting disk info

* fix import

* fix type errors

* add duplicity flag for different source hosts

* fix borrow

* reorder args

* update cargo lock

* use 1byte block sizes and using floating point numbers
This commit is contained in:
Lucy C
2021-11-05 16:03:43 -06:00
committed by Aiden McClelland
parent 44324b7127
commit eac7db091f
4 changed files with 121 additions and 67 deletions

View File

@@ -709,6 +709,17 @@ dependencies = [
"syn 1.0.76",
]
[[package]]
name = "derivative"
version = "2.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b"
dependencies = [
"proc-macro2 1.0.29",
"quote 1.0.9",
"syn 1.0.76",
]
[[package]]
name = "derive_more"
version = "0.99.16"
@@ -870,7 +881,9 @@ dependencies = [
"libc",
"log",
"nix 0.23.0",
"nom 7.0.0",
"num",
"num_enum",
"openssh-keys",
"openssl",
"patch-db",
@@ -1937,6 +1950,28 @@ dependencies = [
"libc",
]
[[package]]
name = "num_enum"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f"
dependencies = [
"derivative",
"num_enum_derive",
]
[[package]]
name = "num_enum_derive"
version = "0.5.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9"
dependencies = [
"proc-macro-crate",
"proc-macro2 1.0.29",
"quote 1.0.9",
"syn 1.0.76",
]
[[package]]
name = "object"
version = "0.26.2"
@@ -2258,6 +2293,16 @@ dependencies = [
"unicode-width",
]
[[package]]
name = "proc-macro-crate"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83"
dependencies = [
"thiserror",
"toml",
]
[[package]]
name = "proc-macro-hack"
version = "0.5.19"

View File

@@ -24,18 +24,19 @@ pub fn create_backup(
data_path
.join(exclude.to_string().trim_start_matches('!'))
.display()
));
)).arg("--allow-source-mismatch");
} else {
data_cmd.arg(format!(
"--exclude={}",
data_path.join(exclude.to_string()).display()
));
)).arg("--allow-source-mismatch");
}
}
let data_output = data_cmd
.env("PASSPHRASE", DEFAULT_PASSWORD)
.arg(data_path)
.arg(format!("file://{}", mountpoint.display().to_string()))
.arg("--allow-source-mismatch")
.stderr(Stdio::piped())
.output()?;
if !data_output.status.success() {
@@ -56,6 +57,7 @@ pub fn restore_backup(
let data_path = std::fs::canonicalize(data_path)?;
let data_output = std::process::Command::new("duplicity")
.arg("--allow-source-mismatch")
.env("PASSPHRASE", DEFAULT_PASSWORD)
.arg("--force")
.arg(format!("file://{}", mountpoint.display().to_string()))