aboutsummaryrefslogtreecommitdiff
path: root/hbak
diff options
context:
space:
mode:
authorHimbeerserverDE <himbeerserverde@gmail.com>2024-02-13 17:07:32 +0100
committerHimbeerserverDE <himbeerserverde@gmail.com>2024-02-13 17:07:32 +0100
commit038044be91bad9979a95e38e2ce59cdda44ae690 (patch)
tree3825f1617203e8f6914caf885651af863bb87ace /hbak
parenta39ddbe991bd188d9e05c95f8025c7c08b0345e0 (diff)
support concurrent hbak and hbakd runs and hbakd clients
Diffstat (limited to 'hbak')
-rw-r--r--hbak/src/main.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/hbak/src/main.rs b/hbak/src/main.rs
index b70d5a6..51c6e17 100644
--- a/hbak/src/main.rs
+++ b/hbak/src/main.rs
@@ -4,7 +4,7 @@ use error::*;
use hbak_common::config::{NodeConfig, RemoteNode, RemoteNodeAuth};
use hbak_common::conn::{AuthConn, DEFAULT_PORT};
use hbak_common::message::SyncInfo;
-use hbak_common::proto::{LatestSnapshots, LocalNode, Node, Snapshot, Volume};
+use hbak_common::proto::{LatestSnapshots, LocalNode, Mode, Node, Snapshot, Volume};
use hbak_common::system;
use hbak_common::{LocalNodeError, RemoteError};
@@ -186,7 +186,7 @@ fn logic() -> Result<()> {
} => {
// Unmount the btrfs before potentially getting killed at prompts.
{
- let local_node = LocalNode::new()?;
+ let local_node = LocalNode::new(Mode::Client)?;
push.retain(|subvol| !local_node.owns_subvol(subvol));
}
@@ -214,7 +214,7 @@ fn logic() -> Result<()> {
mut push,
pull,
} => {
- let local_node = LocalNode::new()?;
+ let local_node = LocalNode::new(Mode::Client)?;
push.retain(|subvol| !local_node.owns_subvol(subvol));
@@ -248,7 +248,7 @@ fn logic() -> Result<()> {
incremental,
subvols,
} => {
- let local_node = LocalNode::new()?;
+ let local_node = LocalNode::new(Mode::Client)?;
let subvols = if subvols.is_empty() {
&local_node.config().subvols
@@ -271,7 +271,7 @@ fn logic() -> Result<()> {
pull,
remote_nodes,
} => {
- let local_node = LocalNode::new()?;
+ let local_node = LocalNode::new(Mode::Client)?;
for remote_node in local_node
.config()
@@ -284,7 +284,7 @@ fn logic() -> Result<()> {
}
}
Commands::Restore { address, subvols } => {
- let local_node = LocalNode::new()?;
+ let local_node = LocalNode::new(Mode::Client)?;
let subvols = if !subvols.is_empty() {
&subvols
@@ -428,7 +428,7 @@ fn restore(local_node: &LocalNode, address: &str, subvols: &[String]) -> Result<
for subvol in subvols {
local_sync_info.volumes.insert(
- Volume::new_local(subvol.to_string())?,
+ Volume::new_local(Mode::Client, subvol.to_string())?,
LatestSnapshots::none(),
);
}