Red Hat Bugzilla – Bug 1486952
add_copy_spec with sizelimit prefers older files if they are in ${FILENAME}.YYYYMMDD format
Last modified: 2018-04-13 07:45:10 EDT
Description of problem: (derived from https://bugzilla.redhat.com/show_bug.cgi?id=1304394#c9) Calling e.g.: self.add_copy_spec("/var/log/secure*", sizelimit=self.limit) for a low log_size / sizelimit collects /var/log/secure and then the _oldest_ secure.* file instead of newest ones. The reason is, we order the files alphanumerically. That works well for /var/log/messages.1 style of log-rotating only. Version-Release number of selected component (if applicable): sos-3.4-* How reproducible: 100% Steps to Reproduce: 1. Have /var/log/secure* (or /var/log/messages*) with many ~1MB files, log-rotated with timestamp suffix like /var/log/secure-20170828 2. sosreport -o logs --log-size=10 3. Check collected secure* or messages* files Actual results: - /var/log/messages and then _oldest_ files are collected - same applies for /var/log/secure files Expected results: - /var/log/messages and then other _newest_ files should be collected - same should apply for /var/log/secure files Additional info:
Fixed via sos 3.5 rebase.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0963