feat: switch NAS transfer from scp to rsync over SSH and update README
Co-authored-by: aider (openai/gpt-5) <aider@aider.chat>
This commit is contained in:
parent
d9f63a5fc1
commit
087742430d
2 changed files with 8 additions and 7 deletions
12
src/main.rs
12
src/main.rs
|
|
@ -192,21 +192,21 @@ fn transfer_files(source_path: &Path, settings: &Settings) -> Result<()> {
|
|||
anyhow::bail!("rsync failed with status: {}", status);
|
||||
}
|
||||
} else {
|
||||
println!("[INFO] Transferring files to NAS via scp...");
|
||||
let mut scp_cmd = Command::new("scp");
|
||||
println!("[INFO] Transferring files to NAS via rsync over SSH...");
|
||||
let mut rsync_cmd = Command::new("rsync");
|
||||
let source = format!(
|
||||
"{}/.",
|
||||
"{}/",
|
||||
source_path.to_str().context("Invalid source path")?
|
||||
);
|
||||
let destination = format!(
|
||||
"{}@{}:{}",
|
||||
settings.nas_user, settings.nas_host, settings.nas_path
|
||||
);
|
||||
scp_cmd.args(["-r", &source, &destination]);
|
||||
rsync_cmd.args(["-r", "-e", "ssh", &source, &destination]);
|
||||
|
||||
let status = scp_cmd.status().context("Failed to execute scp")?;
|
||||
let status = rsync_cmd.status().context("Failed to execute rsync")?;
|
||||
if !status.success() {
|
||||
anyhow::bail!("scp failed with status: {}", status);
|
||||
anyhow::bail!("rsync failed with status: {}", status);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue