Bug 1113582
| Summary: | Timestamp based target log file name configuration in logrotate | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Holger King <HolgerKing> | ||||
| Component: | logrotate | Assignee: | Jan Kaluža <jkaluza> | ||||
| Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | low | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 20 | CC: | jkaluza, tsmetana | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | All | ||||||
| OS: | Solaris | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2015-06-29 21:20:31 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Holger King
2014-06-26 13:05:02 UTC
Hm, maybe you could try "dateformat -%s" to use timestamp. Dear Jan Kaluza, I have to disappoint you: neither "dateformat -%s" nor "dateformat %s" worked with the following "logrotate" configuration (see "fs" attachment) Logrotate produced the following results when using: (1) dateformat -%s -> fs-server.log-%s.gz (2) dateformat %s -> fs-server.log%s.gz Any more hints or did I configure something wrong? Created attachment 914247 [details]
Example logrotate configuration to verify the behaviour regarding a time-based log file name creation after the rotation
Dear Jan Kaluža, based on my last feedback - did you find any configuration mistakes on my side? Would be kind to verify and let me know :) Kind regards, Holger Dear Jan Kaluža, I'm really looking forward to reading from you again. Might be kind to give me a brief feedback :) Kind regards, Holger does it literally create log files named like "fs-server.log-%s.gz"? Your config works for me when testing. Can you please try running logrotate with "-v" argument to get verbose debug output and paste it here? Dear Jan Kaluža, interesting, that it works on your side. We executed the "logrotate" binary using the verbose option "-v": fs@si0vm997:/opt/wcms/fs/logrotate $ /opt/sfw/bin/logrotate -f -v -s /opt/wcms/fs/logrotate/fs.status /opt/wcms/fs/logrotate/fs_date reading config file /opt/wcms/fs/logrotate/fs_date Handling 1 logs rotating pattern: /opt/wcms/fs/log/fs-server.log forced from command line (96 rotations) empty log files are not rotated, old logs are removed considering log /opt/wcms/fs/log/fs-server.log log needs rotating rotating log /opt/wcms/fs/log/fs-server.log, log->rotateCount is 96 Converted ' -%s' -> '-%s' dateext suffix '-%s' glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' glob finding old rotated logs failed running prerotate script copying /opt/wcms/fs/log/fs-server.log to /opt/wcms/fs/log/fs-server.log-%s truncating /opt/wcms/fs/log/fs-server.log compressing log with: /bin/gzip running last action script fs@si0vm997:/opt/wcms/fs/logrotate $ As you can see "logrotate" does not expand the "-%s" of the "dateformat" directive. Does "%s" expand to a unix timestamp calculated since 01.01.1970 or is there a possibility to specify a custom format for time as "YYYYMMHHSS"? Dear Jan Kaluža, did my last post help you analysing/finding the problem? It seems as the dateext suffix is interpreted as pure text and not replaced. Dear Jan Kaluža, long time ago with no feedback. Is there any possibility to get any help here? Kind regards, Holger This message is a reminder that Fedora 20 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 20. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a Fedora 'version' of '20'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora 20 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior this bug is closed as described in the policy above. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. |