RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1486952 - add_copy_spec with sizelimit prefers older files if they are in ${FILENAME}.YYYYMMDD format
Summary: add_copy_spec with sizelimit prefers older files if they are in ${FILENAME}.Y...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: sos
Version: 7.4
Hardware: All
OS: Linux
high
medium
Target Milestone: rc
: ---
Assignee: Pavel Moravec
QA Contact: Jan Houska
URL: https://github.com/sosreport/sos/pull...
Whiteboard:
Depends On:
Blocks: 1567071
TreeView+ depends on / blocked
 
Reported: 2017-08-30 21:18 UTC by Pavel Moravec
Modified: 2018-04-13 11:45 UTC (History)
7 users (show)

Fixed In Version: sos-3.5-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1567071 (view as bug list)
Environment:
Last Closed: 2018-04-10 18:04:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1304394 0 medium CLOSED [RFE] add options to sosreport to limit time range of collected logs 2021-02-22 00:41:40 UTC
Red Hat Product Errata RHEA-2018:0963 0 None None None 2018-04-10 18:05:22 UTC

Internal Links: 1304394

Description Pavel Moravec 2017-08-30 21:18:04 UTC
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 15:16:16 UTC
Fixed via sos 3.5 rebase.

Comment 10 errata-xmlrpc 2018-04-10 18:04:13 UTC
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.