add option to backup a single device

This commit is contained in:
Robin Appelman 2024-06-25 21:14:24 +02:00
commit 0e7839f2b9

View file

@ -16,6 +16,7 @@ mod config;
#[derive(Debug, Parser)]
struct Args {
config: PathBuf,
device: Option<String>,
}
#[tokio::main]
@ -35,6 +36,7 @@ async fn main() -> Result<()> {
let devices = client.current_devices();
info!("found {} devices", devices.len());
for device in devices {
if args.device.is_none() || args.device.as_deref() == Some(device.as_str()) {
let result = timeout(
Duration::from_secs(120),
download(&client, &device, &config.output.target, &device_password),
@ -47,6 +49,7 @@ async fn main() -> Result<()> {
error!(device = device, error = %e, "Failed to download config for {device}");
}
}
}
Ok(())
}