diff options
author | Leonard Kugis <leonard@kug.is> | 2025-04-12 14:25:41 +0200 |
---|---|---|
committer | Leonard Kugis <leonard@kug.is> | 2025-04-12 14:25:41 +0200 |
commit | bfc6151397b6a3d240687e6faba06175f5504770 (patch) | |
tree | 859902145d3c8d94a7ace5dc1ff769f409dd56c2 | |
parent | e33322d98311ab7cfebe85e2cc7f57fabee87461 (diff) | |
download | scripts-bfc6151397b6a3d240687e6faba06175f5504770.tar.gz |
backup: Made cycle count configurable
-rw-r--r-- | backup/src/main.rs | 21 |
1 files 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<u32> } fn read_lines<P: AsRef<Path>>(path: P) -> Result<Vec<String>, Box<dyn Error>> { |