Skip to main content

Module scp

Module scp 

Source
Expand description

File transfer via SCP over SSH (one-shot).

Wrapper around SshClient upload and download methods. Regular files only (no -r / no SFTP subsystem).

§Workload classification

I/O-bound (network + disk). Multi-host --all / --hosts uses crate::concurrency::map_bounded via crate::vps::resolve_host_jobs (one permit = one SSH session).

Multi-file (G-PAR-47): one host, N files → one connect, serial transfers on that session (auth RTT once; &mut client cannot safely fan-out channels without redesign). Parallelism useful at host granularity.

Multi-host × multi-file (G-PAR-48): outer map_bounded per host; inner multi-file session reuse. Batch JSON even when --hosts has one name (G-PAR-36).

Structs§

HostScpResult
Per-host SCP outcome for multi-host batch output.
ScpOptions
Runtime overrides for the scp subcommand (parity with exec).

Functions§

run_scp
Runs the SCP subcommand (upload/download), single host, multi-file, or multi-host.
run_scp_download_with_client
Testable SCP download that accepts the client as a parameter.
run_scp_upload_with_client
Testable SCP upload that accepts the client as a parameter.