Bug 171611 - Patch to fix "extension" option
Summary: Patch to fix "extension" option
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: logrotate
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-10-24 12:30 UTC by Mateus César Gröess
Modified: 2007-11-30 22:11 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-24 13:43:54 UTC
Type: ---
Embargoed:


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

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.


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