tape: avoid writing catalogs for empty backup tasks
This commit is contained in:
parent
7f78528308
commit
4830de408b
@ -435,6 +435,8 @@ fn backup_worker(
|
||||
|
||||
let mut errors = false;
|
||||
|
||||
let mut need_catalog = false; // avoid writing catalog for empty jobs
|
||||
|
||||
for (group_number, group) in group_list.into_iter().enumerate() {
|
||||
progress.done_groups = group_number as u64;
|
||||
progress.done_snapshots = 0;
|
||||
@ -451,6 +453,9 @@ fn backup_worker(
|
||||
task_log!(worker, "skip snapshot {}", info.backup_dir);
|
||||
continue;
|
||||
}
|
||||
|
||||
need_catalog = true;
|
||||
|
||||
let snapshot_name = info.backup_dir.to_string();
|
||||
if !backup_snapshot(worker, &mut pool_writer, datastore.clone(), info.backup_dir)? {
|
||||
errors = true;
|
||||
@ -471,6 +476,9 @@ fn backup_worker(
|
||||
task_log!(worker, "skip snapshot {}", info.backup_dir);
|
||||
continue;
|
||||
}
|
||||
|
||||
need_catalog = true;
|
||||
|
||||
let snapshot_name = info.backup_dir.to_string();
|
||||
if !backup_snapshot(worker, &mut pool_writer, datastore.clone(), info.backup_dir)? {
|
||||
errors = true;
|
||||
@ -489,6 +497,7 @@ fn backup_worker(
|
||||
|
||||
pool_writer.commit()?;
|
||||
|
||||
if need_catalog {
|
||||
task_log!(worker, "append media catalog");
|
||||
|
||||
let uuid = pool_writer.load_writable_media(worker)?;
|
||||
@ -502,6 +511,7 @@ fn backup_worker(
|
||||
bail!("write_catalog_archive failed on second media");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if setup.export_media_set.unwrap_or(false) {
|
||||
pool_writer.export_media_set(worker)?;
|
||||
|
Loading…
Reference in New Issue
Block a user