]> git.proxmox.com Git - pve-manager.git/blobdiff - PVE/APLInfo.pm
appliance index: warn if log rotation fails
[pve-manager.git] / 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");