Skip to content

Commit

Permalink
mxproxmox: Process backup jobs sorted by age
Browse files Browse the repository at this point in the history
  • Loading branch information
donald committed Nov 28, 2023
1 parent 2ce83ca commit ddbbd2c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mxproxmox/mxproxmox
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,15 @@ sub cmd_local_backups {

}
for my $p (@jobs) {
my ($ident, $path, $opt_limit) = @$p;
if (latest_snapshot_age($ident) < 7*24*60*60) {
my ($ident) = @$p;
$p->[3] = latest_snapshot_age($ident);
}

for my $p (sort { $b->[3] <=> $a->[3] } @jobs) {
my ($ident, $path, $opt_limit, $age) = @$p;
if ($age < 7*24*60*60) {
warn "INFO: $ident younger than 7 days. Skipped.\n";
next;
last;
}
while (1) {
if ( server_available_bytes() < 1*1024*1024*1024*1024 ) {
Expand Down

0 comments on commit ddbbd2c

Please sign in to comment.