Bug 171611

Summary: Patch to fix "extension" option
Product: [Fedora] Fedora Reporter: Mateus César Gröess <mateuscg>
Component: logrotateAssignee: Peter Vrabec <pvrabec>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: bojan
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-24 13:43:54 UTC Type: ---
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 Flags
Patch to fix "extension" option. none

Description Mateus César Gröess 2005-10-24 12:30:34 UTC
As Bojan Smojver reported (bug 171093), "extension" option is not working. The
attached patch shall fix it. Thanks Bojan for reporting this problem.

Comment 1 Mateus César Gröess 2005-10-24 12:30:34 UTC
Created attachment 120303 [details]
Patch to fix "extension" option.

Comment 2 Peter Vrabec 2005-10-24 13:43:54 UTC
I think extension option works.

I run "logrotate -vf rot" twice
#cat rot
extension .ext
daily
create
rotate 5
somepath/foo.ext {
}
and i get
$ ls foo*
foo.1.ext  foo.2.ext  foo.ext


Comment 3 Mateus César Gröess 2005-10-24 17:29:46 UTC
Now I see. I (and maybe also Bojan) thought about the config below:

#cat rot
extension .ext
daily
create
rotate 5
somepath/foo {
}

and "logrotate -vf rot" twice would get:
$ ls foo*
foo foo.1.ext foo.2.ext

So, if "somepath/foo.ext" was given, then no extension would be added because
foo.ext already had ".ext" in name, and the result would be "foo.ext.1,
foo.ext.2... But now I understand how it works. Maybe the option in man page
needs to be better described.



Comment 4 Bojan Smojver 2005-10-24 19:54:47 UTC
This is what the manual page claims:

extension ext
        Log files are given the final extension ext after  rotation.  If
        compression  is  used,  the compression extension (normally .gz)
        appears after ext.

From there, I was under the impression that the _rotated_ files will be given
this extension, not that one needs to _have_ files with that extension in order
for them to be rotated. If that was actually the desired behaviour, then the
manual page should say:

extension ext
        Log files with the extension ext can keep the extension after
        rotation. If compression  is  used,  the compression extension
        (normally .gz) appears after ext.

Then the manual page would actually match what logrotate does.