1use serde::{Deserialize, Serialize};
2use std::path::PathBuf;
3
4#[derive(Debug, Clone, Serialize, Deserialize)]
5pub struct BackupConfig {
6 pub enabled: bool,
8
9 pub backup_dir: PathBuf,
11
12 pub interval_hours: u64,
14
15 pub max_backups: usize,
17
18 pub format: String,
20
21 pub compress: bool,
23
24 pub verify_after_backup: bool,
26}
27
28impl Default for BackupConfig {
29 fn default() -> Self {
30 Self {
31 enabled: false,
32 backup_dir: dirs::config_dir()
33 .unwrap_or_else(|| PathBuf::from("."))
34 .join("chamber")
35 .join("backups"),
36 interval_hours: 24, max_backups: 7, format: "backup".to_string(),
39 compress: true,
40 verify_after_backup: true,
41 }
42 }
43}