Refuse to overwrite pointer names when generated from timestamps
This commit is contained in:
parent
9b8ab8bd0a
commit
34ec8966b2
@ -157,7 +157,9 @@ pub fn backup_source_to_destination<PT: ProgressTracker>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
||||||
|
if pile.read_pointer(pointer_name.as_str())?.is_some() {
|
||||||
|
bail!("Pointer by name {:?} already exists; refusing to overwrite.", pointer_name);
|
||||||
|
}
|
||||||
info!("Will write as pointer {:?}.", pointer_name);
|
info!("Will write as pointer {:?}.", pointer_name);
|
||||||
|
|
||||||
info!("Searching for suitable parents.");
|
info!("Searching for suitable parents.");
|
||||||
@ -218,6 +220,9 @@ pub fn backup_source_to_destination<PT: ProgressTracker>(
|
|||||||
let pile = open_pile(&absolute_dest_path, &pile_descriptor)?;
|
let pile = open_pile(&absolute_dest_path, &pile_descriptor)?;
|
||||||
|
|
||||||
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
||||||
|
if pile.read_pointer(pointer_name.as_str())?.is_some() {
|
||||||
|
bail!("Pointer by name {:?} already exists; refusing to overwrite.", pointer_name);
|
||||||
|
}
|
||||||
info!("Will write as pointer {:?}.", pointer_name);
|
info!("Will write as pointer {:?}.", pointer_name);
|
||||||
|
|
||||||
let mut chunker = yama::chunking::RecursiveChunker::new(SENSIBLE_THRESHOLD, &pile);
|
let mut chunker = yama::chunking::RecursiveChunker::new(SENSIBLE_THRESHOLD, &pile);
|
||||||
|
@ -182,7 +182,9 @@ pub fn backup_remote_source_to_destination<PT: ProgressTracker + Send + 'static>
|
|||||||
let pile = open_pile(&absolute_dest_path, &pile_descriptor)?;
|
let pile = open_pile(&absolute_dest_path, &pile_descriptor)?;
|
||||||
|
|
||||||
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
let pointer_name = get_pointer_name_at(&source_name, Utc::now());
|
||||||
|
if pile.read_pointer(pointer_name.as_str())?.is_some() {
|
||||||
|
bail!("Pointer by name {:?} already exists; refusing to overwrite.", pointer_name);
|
||||||
|
}
|
||||||
info!("Will write as pointer {:?}.", pointer_name);
|
info!("Will write as pointer {:?}.", pointer_name);
|
||||||
|
|
||||||
info!("Searching for suitable parents.");
|
info!("Searching for suitable parents.");
|
||||||
|
Loading…
Reference in New Issue
Block a user