Bug 171611 - Patch to fix "extension" option
Patch to fix "extension" option
Product: Fedora
Classification: Fedora
Component: logrotate (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
Depends On:
  Show dependency treegraph
Reported: 2005-10-24 08:30 EDT by Mateus César Gröess
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-24 09:43:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Patch to fix "extension" option. (512 bytes, patch)
2005-10-24 08:30 EDT, Mateus César Gröess
no flags Details | Diff

  None (edit)
Description Mateus César Gröess 2005-10-24 08:30:34 EDT
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 08:30:34 EDT
Created attachment 120303 [details]
Patch to fix "extension" option.
Comment 2 Peter Vrabec 2005-10-24 09:43:54 EDT
I think extension option works.

I run "logrotate -vf rot" twice
#cat rot
extension .ext
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 13:29:46 EDT
Now I see. I (and maybe also Bojan) thought about the config below:

#cat rot
extension .ext
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 15:54:47 EDT
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.

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