forked from blacklabelops/logrotate
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
C1 - bugA bug, if something isn't workingA bug, if something isn't workingT3 - mediumThe bug reports cosmetic items, formatting, spelling, colors, etc.The bug reports cosmetic items, formatting, spelling, colors, etc.
Description
Contact Details
What happened?
Logrotation affects too many files.
Let's say I use this configuration:
177 volumes:
178 - ./log/apache2/:/var/log/apache2
179 - ./data/logrotate:/logrotate-status
180
181 environment:
182 TZ: Europe/Berlin
183 LOGROTATE_STATUSFILE: /logrotate-status/logrotate.status
184 LOGS_DIRECTORIES: /var/log
185 LOGROTATE_CRONSCHEDULE: "0 35 23 * * *"
186 LOGROTATE_COPIES: 30
187 LOGROTATE_SIZE: 10M
188 LOGROTATE_DATEFORMAT: "-%Y%m%d"
189 LOGROTATE_COMPRESSION: compress
190 LOG_FILE_ENDINGS: logand my log dir has the following structure:
log/
log/mail
log/apache2
log/apache2/error.log
log/apache2/other_vhosts_access.log
log/apache2/access.log
log/apache2/do-no-rotate
I would expect that do-not-rotate will not getting rotated, because LOG_FILE_ENDINGS are set to log and this file is missing this suffix. The docker logs suggest, that the file is going to get rotated anyway:
# docker compose logs -f logrotate
nextcloud-logrotate | Found new file /var/log/apache2/error.log, Processing...
nextcloud-logrotate | Inserting new /var/log/apache2/error.log to /usr/bin/logrotate.d/logrotate.conf
nextcloud-logrotate | Found new file /var/log/apache2/other_vhosts_access.log, Processing...
nextcloud-logrotate | Inserting new /var/log/apache2/other_vhosts_access.log to /usr/bin/logrotate.d/logrotate.conf
nextcloud-logrotate | Found new file /var/log/apache2/access.log, Processing...
nextcloud-logrotate | Inserting new /var/log/apache2/access.log to /usr/bin/logrotate.d/logrotate.conf
nextcloud-logrotate | Found new file /var/log/apache2/do-not-rotate, Processing...
nextcloud-logrotate | Inserting new /var/log/apache2/do-not-rotate to /usr/bin/logrotate.d/logrotate.conf
nextcloud-logrotate | # deactivate mail
nextcloud-logrotate | nomail
nextcloud-logrotate |
nextcloud-logrotate | # move the log files to another directory?
nextcloud-logrotate |
nextcloud-logrotate | /var/log/apache2/error.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/other_vhosts_access.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/access.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/do-not-rotate {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | # deactivate mail
nextcloud-logrotate | nomail
nextcloud-logrotate |
nextcloud-logrotate | # move the log files to another directory?
nextcloud-logrotate |
nextcloud-logrotate | /var/log/apache2/error.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/other_vhosts_access.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/access.log {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | /var/log/apache2/do-not-rotate {
nextcloud-logrotate | su root root
nextcloud-logrotate | rotate 30
nextcloud-logrotate | missingok
nextcloud-logrotate | compress
nextcloud-logrotate | delaycompress
nextcloud-logrotate | copytruncate
nextcloud-logrotate | size 10M
nextcloud-logrotate | dateext
nextcloud-logrotate | dateformat -%Y%m%d
nextcloud-logrotate | }
nextcloud-logrotate | 2025-10-30T10:17:29.855+01:00 scheduler.go:44 ▶ NOTICE New job registered "logrotate-with-autoupdate" - "/bin/bash -c \"/usr/bin/logrotate.d/update-logrotate.sh && /usr/sbin/logrotate --state=/logrotate-status/logrotate.status /usr/bin/logrotate.d/logrotate.conf \"" - "0 35 23 * * *"
nextcloud-logrotate | 2025-10-30T10:17:29.855+01:00 scheduler.go:55 ▶ DEBUG Starting scheduler with 1 jobs
It also did a logrotate on rotated files like /var/log/apache2/access.log-20251021-20251022-20251023-20251024.
Version
1.0.2 (Default)
What browsers are you seeing the problem on?
No response
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
C1 - bugA bug, if something isn't workingA bug, if something isn't workingT3 - mediumThe bug reports cosmetic items, formatting, spelling, colors, etc.The bug reports cosmetic items, formatting, spelling, colors, etc.