mirror of https://github.com/digint/btrbk
Merge e387dea986
into 4fcbbad802
commit
c67d2eeaa3
7
btrbk
7
btrbk
|
@ -85,6 +85,7 @@ my %config_options = (
|
|||
timestamp_format => { default => "long", accept => [ "short", "long", "long-iso" ], context => [ "global", "volume", "subvolume" ] },
|
||||
snapshot_dir => { default => undef, accept_file => { relative => 1, absolute => 1 }, context => [ "global", "volume", "subvolume" ] },
|
||||
snapshot_name => { c_default => 1, accept_file => { name_only => 1 }, context => [ "subvolume" ], deny_glob_context => 1 }, # NOTE: defaults to the subvolume name (hardcoded)
|
||||
snapshot_name_prefix_fullpath => { default => "no", accept => ["yes", "no" ] },
|
||||
snapshot_create => { default => "always", accept => [ "no", "always", "ondemand", "onchange" ], context => [ "global", "volume", "subvolume" ] },
|
||||
incremental => { default => "yes", accept => [ "yes", "no", "strict" ] },
|
||||
incremental_prefs => { default => \@incremental_prefs_default, accept_regexp => qr/^$incremental_prefs_match($split_match$incremental_prefs_match)*$/, split => $split_match },
|
||||
|
@ -6999,6 +7000,12 @@ MAIN:
|
|||
my $postfix_counter = $lookup[0] // -1;
|
||||
$postfix_counter++;
|
||||
my $snapshot_name = $snapshot_basename . '.' . $timestamp . ($postfix_counter ? "_$postfix_counter" : "");
|
||||
if ( config_key($svol, "snapshot_name_prefix_fullpath") eq "yes" ) {
|
||||
my $sanitized_snaproot = $snaproot->{PATH};
|
||||
# replace all /s with _ in the root
|
||||
$sanitized_snaproot =~ s/\//_/msxg;
|
||||
$snapshot_name = $sanitized_snaproot.$snapshot_name;
|
||||
}
|
||||
|
||||
if(@unconfirmed_target_name) {
|
||||
INFO "Assuming non-present subvolume \"$snapshot_name\" in skipped targets: " . join(", ", map { "\"$_->{PRINT}\"" } @unconfirmed_target_name);
|
||||
|
|
|
@ -87,6 +87,10 @@ snapshot_dir _btrbk_snap
|
|||
# disk when btrbk terminates.
|
||||
#btrfs_commit_delete no
|
||||
|
||||
# Include full path in the snapshot name to distinguish between snapshots
|
||||
# with the same name, but different roots
|
||||
# snapshot_name_prefix_fullpath yes
|
||||
|
||||
|
||||
#
|
||||
# Volume section (optional): "volume <volume-directory>"
|
||||
|
|
Loading…
Reference in New Issue