Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1486952 - add_copy_spec with sizelimit prefers older files if they are in ${FILENAME}.YYYYMMDD format
add_copy_spec with sizelimit prefers older files if they are in ${FILENAME}.Y...
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sos (Show other bugs)
7.4
All Linux
high Severity medium
: rc
: ---
Assigned To: Pavel Moravec
Jan Houska
https://github.com/sosreport/sos/pull...
:
Depends On:
Blocks: 1567071
  Show dependency treegraph
 
Reported: 2017-08-30 17:18 EDT by Pavel Moravec
Modified: 2018-04-13 07:45 EDT (History)
7 users (show)

See Also:
Fixed In Version: sos-3.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1567071 (view as bug list)
Environment:
Last Closed: 2018-04-10 14:04:13 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0963 None None None 2018-04-10 14:05 EDT

  None (edit)
Description Pavel Moravec 2017-08-30 17:18:04 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:
Comment 1 Pavel Moravec 2017-11-02 11:16:16 EDT
Fixed via sos 3.5 rebase.
Comment 10 errata-xmlrpc 2018-04-10 14:04:13 EDT
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

Note You need to log in before you can comment on or make changes to this bug.