Sample Header Ad - 728x90

Can logrotate automatically track the size of the log file and rotate it when its size exceeds the limit?

0 votes
1 answer
1508 views
I saw the size directive and created the configuration file /etc/logrotate.d/test: /home/user/log1 { size 100 rotate 3 compress } but it doesn't work as I expect. The file should be rotated when its size becomes more than 100 bytes, and this does not happen. Nothing happens when the file size exceeds the limit, the file is not rotated, a new archive with the old log1 file is not created Is it possible to achieve this behavior with logrotate? OS is ubuntu 20
Asked by ibse (371 rep)
Dec 5, 2022, 11:11 AM
Last activity: May 8, 2024, 08:40 AM