From bfc6151397b6a3d240687e6faba06175f5504770 Mon Sep 17 00:00:00 2001 From: Leonard Kugis Date: Sat, 12 Apr 2025 14:25:41 +0200 Subject: backup: Made cycle count configurable --- backup/src/main.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/backup/src/main.rs b/backup/src/main.rs index 272c952..22b573f 100644 --- a/backup/src/main.rs +++ b/backup/src/main.rs @@ -11,18 +11,27 @@ use std::{ process::Command, }; +/// Backup-Tool mit inkrementeller Sicherung und Rotation +#[derive(Parser, Debug)] +#[command(author, version, about, long_about = None)] +struct Args { + /// Pfad zur Konfigurationsdatei (JSON) + #[arg(short, long)] + config: PathBuf, + + /// Ausführliche Ausgabe + #[arg(short, long, default_value_t = false)] + verbose: bool, +} + #[derive(Debug, Deserialize)] -struct BackupConfig { +struct Config { backup_dir: String, rotate_dir: String, timestamp_file: String, source_file: String, exclude_file: String, -} - -#[derive(Debug, Deserialize)] -struct Config { - backup: BackupConfig, + cycles: Option } fn read_lines>(path: P) -> Result, Box> { -- cgit v1.2.3