[pve-devel] [PATCH manager 2/6] warn on very small backup size
Thomas Lamprecht
t.lamprecht at proxmox.com
Fri Sep 1 15:24:27 CEST 2017
fixes #1468 - partially
Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
PVE/VZDump.pm | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/PVE/VZDump.pm b/PVE/VZDump.pm
index f29739bb..91258bc1 100644
--- a/PVE/VZDump.pm
+++ b/PVE/VZDump.pm
@@ -984,26 +984,30 @@ sub exec_backup_task {
}
debugmsg ('info', "creating archive '$task->{tarfile}'", $logfd);
$plugin->archive($task, $vmid, $task->{tmptar}, $comp);
rename ($task->{tmptar}, $task->{tarfile}) ||
die "unable to rename '$task->{tmptar}' to '$task->{tarfile}'\n";
# determine size
$task->{size} = (-s $task->{tarfile}) || 0;
my $cs = format_size ($task->{size});
debugmsg ('info', "archive file size: $cs", $logfd);
+ if ($task->{size} < 1024) {
+ debugmsg ('warn', "backup archive size is unusual small (< 1KB)", $logfd);
+ }
+
# purge older backup
if ($maxfiles && $opts->{remove}) {
my $bklist = get_backup_file_list($opts->{dumpdir}, $bkname, $task->{tarfile});
$bklist = [ sort { $b->[1] <=> $a->[1] } @$bklist ];
while (scalar (@$bklist) >= $maxfiles) {
my $d = pop @$bklist;
debugmsg ('info', "delete old backup '$d->[0]'", $logfd);
unlink $d->[0];
my $logfn = $d->[0];
$logfn =~ s/\.(tgz|((tar|vma)(\.(gz|lzo))?))$/\.log/;
unlink $logfn;
--
2.11.0
More information about the pve-devel
mailing list