Score:1

logrotate not removing old files

rw flag

I'm trying to create a logrotate configuration that is the same for all log files. Right now I have

/var/log/* {
   size 100k
   rotate 5
   missingok
   compress
}

I created a shell script that makes dummy log files to test logrotate's capabilities. The script is

for i in $(seq 1 100); do
   echo $RANDOM > /var/log/Random.log.${i};
done;
touch -a -m -t 201512180130.09 /var/log/Random.log*

However, when I run sudo logrotate -d /etc/logrotate.conf the Random.log* files are compressed, but I am still retaining all 100 log files instead of just 5.

Please help!

I sit in a Tesla and translated this thread with Ai:

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.