mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 02:11:53 +00:00
7
system-images/compat/Cargo.lock
generated
7
system-images/compat/Cargo.lock
generated
@@ -887,7 +887,6 @@ dependencies = [
|
||||
"rpc-toolkit",
|
||||
"rust-argon2",
|
||||
"scopeguard",
|
||||
"sequence_trie",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_with",
|
||||
@@ -2814,12 +2813,6 @@ dependencies = [
|
||||
"pest",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "sequence_trie"
|
||||
version = "0.3.6"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "1ee22067b7ccd072eeb64454b9c6e1b33b61cd0d49e895fd48676a184580e0c3"
|
||||
|
||||
[[package]]
|
||||
name = "serde"
|
||||
version = "1.0.130"
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
use std::{path::Path, process::Stdio};
|
||||
|
||||
use embassy::disk::main::DEFAULT_PASSWORD;
|
||||
|
||||
pub fn create_backup(
|
||||
mountpoint: impl AsRef<Path>,
|
||||
data_path: impl AsRef<Path>,
|
||||
@@ -30,11 +32,18 @@ pub fn create_backup(
|
||||
));
|
||||
}
|
||||
}
|
||||
let data_res = data_cmd
|
||||
let data_output = data_cmd
|
||||
.env("PASSPHRASE", DEFAULT_PASSWORD)
|
||||
.arg(data_path)
|
||||
.arg(format!("file://{}", mountpoint.display().to_string()))
|
||||
.output();
|
||||
data_res?;
|
||||
.stderr(Stdio::piped())
|
||||
.output()?;
|
||||
if !data_output.status.success() {
|
||||
return Err(anyhow::anyhow!(
|
||||
"duplicity error: {}",
|
||||
String::from_utf8(data_output.stderr).unwrap()
|
||||
));
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
@@ -47,6 +56,7 @@ pub fn restore_backup(
|
||||
let data_path = std::fs::canonicalize(data_path)?;
|
||||
|
||||
let data_output = std::process::Command::new("duplicity")
|
||||
.env("PASSPHRASE", DEFAULT_PASSWORD)
|
||||
.arg("--force")
|
||||
.arg(format!("file://{}", mountpoint.display().to_string()))
|
||||
.arg(&data_path)
|
||||
|
||||
Reference in New Issue
Block a user