diff options
author | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-02-13 17:54:03 +0100 |
---|---|---|
committer | HimbeerserverDE <himbeerserverde@gmail.com> | 2024-02-13 17:54:03 +0100 |
commit | fa6d350c9f40b68bc58b937c98ab3c4890617f02 (patch) | |
tree | 9781bf465ccac9493ef33b88636b7b76e6722a59 /hbak/src | |
parent | 86d53c781bef28b317b5afb59aaaef84b1092d84 (diff) |
fix snapshot and backup dirs not pointing to the correct mountpoint in server mode
Diffstat (limited to 'hbak/src')
-rw-r--r-- | hbak/src/main.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/hbak/src/main.rs b/hbak/src/main.rs index 51c6e17..9ea0332 100644 --- a/hbak/src/main.rs +++ b/hbak/src/main.rs @@ -382,11 +382,12 @@ fn sync( return Err(RemoteError::AccessDenied); } - if snapshot.backup_path().exists() { + if snapshot.backup_path(Mode::Client).exists() { return Err(RemoteError::Immutable); } - let file = File::create(snapshot.streaming_path()).map_err(|_| RemoteError::RxError)?; + let file = File::create(snapshot.streaming_path(Mode::Client)) + .map_err(|_| RemoteError::RxError)?; println!("Receiving {} from {}", snapshot, remote_node.address); @@ -394,8 +395,11 @@ fn sync( }; let rx_finish = |snapshot: Snapshot| { - fs::rename(snapshot.streaming_path(), snapshot.backup_path()) - .map_err(|_| RemoteError::RxError)?; + fs::rename( + snapshot.streaming_path(Mode::Client), + snapshot.backup_path(Mode::Client), + ) + .map_err(|_| RemoteError::RxError)?; println!("Received {} from {}", snapshot, remote_node.address); @@ -445,7 +449,7 @@ fn restore(local_node: &LocalNode, address: &str, subvols: &[String]) -> Result< return Err(RemoteError::AccessDenied); } - if snapshot.snapshot_path().exists() { + if snapshot.snapshot_path(Mode::Client).exists() { return Err(RemoteError::Immutable); } |