mirror of
https://github.com/schoebel/mars
synced 2025-02-12 01:57:41 +00:00
marsadm: safeguard deletion of last logfile
This commit is contained in:
parent
e9e5c1a1da
commit
f871eb9514
@ -5125,9 +5125,12 @@ sub logdelete_res {
|
|||||||
}
|
}
|
||||||
|
|
||||||
my $nr = 0;
|
my $nr = 0;
|
||||||
for (;;) {
|
|
||||||
my $first = shift(@paths);
|
my $first = shift(@paths);
|
||||||
|
for (;;) {
|
||||||
last unless $first;
|
last unless $first;
|
||||||
|
my $next = shift(@paths);
|
||||||
|
# never delete the very last logfile
|
||||||
|
last unless $next;
|
||||||
$nr = $first;
|
$nr = $first;
|
||||||
$nr =~ s/^.*log-([0-9]+)-.+$/$1/;
|
$nr =~ s/^.*log-([0-9]+)-.+$/$1/;
|
||||||
next unless $nr < $max_deletable;
|
next unless $nr < $max_deletable;
|
||||||
@ -5135,6 +5138,7 @@ sub logdelete_res {
|
|||||||
lprint "chosen '$first' for deletion\n" if $verbose;
|
lprint "chosen '$first' for deletion\n" if $verbose;
|
||||||
|
|
||||||
_create_delete($first);
|
_create_delete($first);
|
||||||
|
$first = $next;
|
||||||
}
|
}
|
||||||
# Determine whether a parallel join-resource is ongoing
|
# Determine whether a parallel join-resource is ongoing
|
||||||
my $transient_join = 0;
|
my $transient_join = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user