]> git.proxmox.com Git - pve-manager.git/commitdiff
appliance index: rotate update log if bigger than 256 KiB
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Feb 2024 12:40:31 +0000 (13:40 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 20 Feb 2024 12:40:41 +0000 (13:40 +0100)
50 KiB is really tiny and while this log file is not _that_ important,
spending a few KiB more to keep much older logs around is almost
always a win-win situation, now that root storage size is rather some
hundred GB in most setups.

Drop the unused size variable while touching this, which was the
actual thing that made me look closer here.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
PVE/APLInfo.pm

index f98ecfe7008a9a862f78b3edb84eb16ed3045f3a..a4acf49071719976acf02bc11d1403717d31a46a 100644 (file)
@@ -213,8 +213,7 @@ sub get_apl_sources {
 sub update {
     my ($proxy) = @_;
 
-    my $size;
-    if (($size = (-s $logfile) || 0) > (1024*50)) {
+    if (-s $logfile || 0 > 1024 * 256) {
        rename($logfile, "$logfile.0");
     }
     my $logfd = IO::File->new (">>$logfile");