Score:0

The size of log files is still big after logrotate on ubuntu 20.04

in flag

logrotate was setup on Ubuntu 20.04 to limit the besu log file size to 10MB, keep 4 weeks log with rotating weekly and delete the old log file. Here is the besu conf:

#for besu log
/home/log/besu/* {
        size 10M
        missingok
        rotate 4
        weekly
        postrotate
                /usr/bin/find /home/log/besu/ -name "node*.log.*" -type f -mtime +0 -exec rm {}
\;
        endscript
}

The log file is named as node[1-4].log. Here is the ls output:

enter image description here

As the output shows, there are 18 files started with node1 and the file size is 1.6GB. It seems that none of the above conf goal has been achieved. What is missing in the log conf file?

in flag
Silly question, but you’ve confirmed the process that runs the script has access to the log location, yes? Are the logs actually being written to `/home/log` and not `/var/log`?
in flag
The log is written to /home/log by code and the owner of the log file under /home/log is root which is the user I have log in.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.