summaryrefslogtreecommitdiff
path: root/src/cmd/backup.rs
diff options
context:
space:
mode:
authorAlexander Batischev <eual.jp@gmail.com>2021-07-28 20:16:53 +0300
committerAlexander Batischev <eual.jp@gmail.com>2021-07-28 23:02:56 +0300
commit640f8d874d627489efe2f55333e1f9ae8120596b (patch)
tree7acbc86ea3cc6a4641a140af30f234baf9d3dd06 /src/cmd/backup.rs
parent3a1e5f10dd8aef4bc02f76e735c4a3244147ffe8 (diff)
downloadobnam2-640f8d874d627489efe2f55333e1f9ae8120596b.tar.gz
After the backup, print out a list of new CACHEDIR.TAGs
Diffstat (limited to 'src/cmd/backup.rs')
-rw-r--r--src/cmd/backup.rs14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/cmd/backup.rs b/src/cmd/backup.rs
index d574b96..6777856 100644
--- a/src/cmd/backup.rs
+++ b/src/cmd/backup.rs
@@ -26,18 +26,18 @@ impl Backup {
let oldtemp = NamedTempFile::new()?;
let newtemp = NamedTempFile::new()?;
- let (count, warnings) = match genlist.resolve("latest") {
+ let (is_incremental, (count, warnings, new_tags)) = match genlist.resolve("latest") {
Err(_) => {
info!("fresh backup without a previous generation");
let mut run = BackupRun::initial(config, &client)?;
let old = run.start(None, oldtemp.path())?;
- run.backup_roots(config, &old, newtemp.path())?
+ (false, run.backup_roots(config, &old, newtemp.path())?)
}
Ok(old_id) => {
info!("incremental backup based on {}", old_id);
let mut run = BackupRun::incremental(config, &client)?;
let old = run.start(Some(&old_id), oldtemp.path())?;
- run.backup_roots(config, &old, newtemp.path())?
+ (true, run.backup_roots(config, &old, newtemp.path())?)
}
};
@@ -47,6 +47,14 @@ impl Backup {
println!("warning: {}", w);
}
+ if is_incremental && !new_tags.is_empty() {
+ println!("New CACHEDIR.TAG files since the last backup:");
+ for t in new_tags {
+ println!("- {:?}", t);
+ }
+ println!("You can configure Obnam to ignore all such files by setting `exclude_cache_tag_directories` to `false`.");
+ }
+
report_stats(&runtime, count, &gen_id, warnings.len())?;
Ok(())