summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-01-16 16:06:01 +0000
committerLars Wirzenius <liw@liw.fi>2022-01-16 16:06:01 +0000
commitdf7f61482fbe65819cdfebddcb2edc15e6d86b2d (patch)
treecabc9af62251c16290d6dcfa7270445f992a759f
parent519a5f9d4ec3204f866912eb8250adc319ed4462 (diff)
parent11253df6ac95554a895aa1412c75020ce663260c (diff)
downloadobnam2-df7f61482fbe65819cdfebddcb2edc15e6d86b2d.tar.gz
Merge branch 'skipped' into 'main'
docs: add some explanation of what Skipped should mean See merge request obnam/obnam!212
-rw-r--r--src/backup_reason.rs3
-rw-r--r--src/policy.rs9
2 files changed, 11 insertions, 1 deletions
diff --git a/src/backup_reason.rs b/src/backup_reason.rs
index 590f470..9a17d80 100644
--- a/src/backup_reason.rs
+++ b/src/backup_reason.rs
@@ -7,7 +7,8 @@ use std::fmt;
/// Represent the reason a file is in a backup.
#[derive(Debug, Copy, Clone)]
pub enum Reason {
- /// File was skipped for some reason, but carried over without changes.
+ /// File was skipped due to policy, but carried over without
+ /// changes.
Skipped,
/// File is new, compared to previous backup.
IsNew,
diff --git a/src/policy.rs b/src/policy.rs
index 9b66c1d..7241f0f 100644
--- a/src/policy.rs
+++ b/src/policy.rs
@@ -6,6 +6,15 @@ use crate::generation::LocalGeneration;
use log::{debug, warn};
/// Policy for what gets backed up.
+///
+/// The policy allows two aspects to be controlled:
+///
+/// * should new files )(files that didn't exist in the previous
+/// backup be included in the new backup?
+/// * should files that haven't been changed since the previous backup
+/// be included in the new backup?
+///
+/// If policy doesn't allow a file to be included, it's skipped.
pub struct BackupPolicy {
new: bool,
old_if_changed: bool,