From 805cae93fdee05a5a9ca95583b860762573ef977 Mon Sep 17 00:00:00 2001 From: Thomas Lamprecht Date: Tue, 20 Feb 2024 13:40:31 +0100 Subject: [PATCH] appliance index: rotate update log if bigger than 256 KiB 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 --- PVE/APLInfo.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/PVE/APLInfo.pm b/PVE/APLInfo.pm index f98ecfe7..a4acf490 100644 --- a/PVE/APLInfo.pm +++ b/PVE/APLInfo.pm @@ -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");