I have a log folder under under /var/USER/mylogs and there on a daily basis log files in format "DATE-mylogile.log". DATE is formatted as "%d-%m-%Y".
So in my folder i have for example these log files:
12-01-2024-mylogfile.log
13-01-2024-mylogfile.log
14.01-2024-mylogfile.log
...
Now i want to use logrotate to rotate the logs. My test-Configuration looks like this:
/var/USER/mylogs/*.log {
weekly
rotate 4
compress
missingok
dateext
dateformat -%d-%m-%Y
}
But when logrotate runs it creates and gz-Archive for every single log file like:
12.01-2024-mylogfile.log-12-03-2024.gz
13.01-2024-mylogfile.log-13-03-2024.gz
14.01-2024-mylogfile.log-14-03-2024.gz
But i want that logrotate creates weekly one gz-Archive which includes all the single log files from the week, so that there is only one gz-Archive like:
mylogfile.log-14-03-2024.gz
But there i'm stuck - so is it possible and how can i do this?