]> git.proxmox.com Git - pve-manager.git/commitdiff
appliance index: warn if log rotation fails
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Feb 2024 13:27:19 +0000 (14:27 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 28 Feb 2024 13:27:19 +0000 (14:27 +0100)
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/APLInfo.pm

index 07542743b0f9a987d701a75cae813f995732ee2d..affdde8ecdbe9dce66c8168fc6078f32d7f58252 100644 (file)
@@ -213,8 +213,9 @@ sub get_apl_sources {
 sub update {
     my ($proxy) = @_;
 
-    if ((-s $logfile || 0) > 1024 * 256) {
-       rename($logfile, "$logfile.0");
+    my $logfile_size = -s $logfile || 0;
+    if ($logfile_size > 1024 * 256) {
+       rename($logfile, "$logfile.0") or warn "failed to rotate log file $logfile - $!\n";
     }
     my $logfd = IO::File->new (">>$logfile");
     logmsg($logfd, "starting update");