mirror of https://github.com/digint/btrbk
btrbk: bugfix: crash if "snapshot_create onchange" is set and no snapshots are present
parent
7b9021d5c8
commit
005e5c63be
15
btrbk
15
btrbk
|
@ -1825,12 +1825,17 @@ MAIN:
|
||||||
elsif($snapshot_create eq "onchange") {
|
elsif($snapshot_create eq "onchange") {
|
||||||
# check if latest snapshot is up-to-date with source subvolume (by generation)
|
# check if latest snapshot is up-to-date with source subvolume (by generation)
|
||||||
my $latest = get_latest_snapshot_child($sroot, $svol);
|
my $latest = get_latest_snapshot_child($sroot, $svol);
|
||||||
if($latest && ($latest->{gen} == $svol->{gen})) {
|
if($latest) {
|
||||||
INFO "Snapshot creation skipped: snapshot_create=onchange, snapshot is up-to-date: $latest->{PRINT}";
|
if($latest->{gen} == $svol->{gen}) {
|
||||||
$config_subvol->{SNAPSHOT_UP_TO_DATE} = $latest;
|
INFO "Snapshot creation skipped: snapshot_create=onchange, snapshot is up-to-date: $latest->{PRINT}";
|
||||||
next;
|
$config_subvol->{SNAPSHOT_UP_TO_DATE} = $latest;
|
||||||
|
next;
|
||||||
|
}
|
||||||
|
DEBUG "Snapshot creation enabled: snapshot_create=onchange, gen=$svol->{gen} > snapshot_gen=$latest->{gen}";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
DEBUG "Snapshot creation enabled: snapshot_create=onchange, no snapshots found";
|
||||||
}
|
}
|
||||||
DEBUG "Snapshot creation enabled: snapshot_create=onchange, gen=$svol->{gen} > snapshot_gen=$latest->{gen}";
|
|
||||||
}
|
}
|
||||||
elsif($snapshot_create eq "ondemand") {
|
elsif($snapshot_create eq "ondemand") {
|
||||||
# check if at least one target is present
|
# check if at least one target is present
|
||||||
|
|
Loading…
Reference in New Issue