logrotate, systemd, stopped rotating a log
Leap 15.3. Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file. I noticed the logrotate.conf file is empty. Before delving any further I wanted to assure or disabuse myself of the notion that it matters not, as long as the proper configurations are in /etc/logrotate.d/def_for_my_log.
It compressed fine when run manually - logrotate -f /etc/logrotate.d/my_file_name so I can presume my "size" parameter in the config file has an error. joe a On 8/8/2022 1:57 PM, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty. Before delving any further I wanted to assure or disabuse myself of the notion that it matters not, as long as the proper configurations are in /etc/logrotate.d/def_for_my_log.
What does the + sign indicate in the size directive? Some conf files have it, some don't. + Like "size +4096k" Did not find it in the man pages. On 8/8/2022 2:26 PM, joe a wrote:
It compressed fine when run manually -
logrotate -f /etc/logrotate.d/my_file_name
so I can presume my "size" parameter in the config file has an error.
joe a
On 8/8/2022 1:57 PM, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty. Before delving any further I wanted to assure or disabuse myself of the notion that it matters not, as long as the proper configurations are in /etc/logrotate.d/def_for_my_log.
On 09.08.2022 00:22, joe a wrote:
What does the + sign indicate in the size directive? Some conf files have it, some don't. +
Like "size +4096k"
logrotate should parse both N and +N identically. I guess it is a matter of personal preference.
Did not find it in the man pages.
"Numbers must be specified in a format understood by strtoul(3)".
On 8/8/2022 2:26 PM, joe a wrote:
It compressed fine when run manually -
logrotate -f /etc/logrotate.d/my_file_name
so I can presume my "size" parameter in the config file has an error.
joe a
On 8/8/2022 1:57 PM, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
/etc/logrotate.d is included from configuration file, so if configuration file is empty nothing in /etc/logrotate.d is used. Unless you have different invocation of logrotate somewhere. And "logrotate.conf" is rather useless because it is unknown where this file is located. Is it /etc/logrotate.conf? Or /tmp/logrotate.conf? Or somewhere else?
Before delving any further
I wanted to assure or disabuse myself of the notion that it matters not, as long as the proper configurations are in /etc/logrotate.d/def_for_my_log.
OK then. On 8/9/2022 3:46 AM, Andrei Borzenkov wrote:
On 09.08.2022 00:22, joe a wrote:
What does the + sign indicate in the size directive? Some conf files have it, some don't. +
Like "size +4096k"
logrotate should parse both N and +N identically. I guess it is a matter of personal preference.
So it seems.
Did not find it in the man pages.
"Numbers must be specified in a format understood by strtoul(3)".
If only that had been mentioned where I was looking, oddly enough, under "size".
On 8/8/2022 2:26 PM, joe a wrote:
It compressed fine when run manually -
logrotate -f /etc/logrotate.d/my_file_name
so I can presume my "size" parameter in the config file has an error.
joe a
On 8/8/2022 1:57 PM, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
/etc/logrotate.d is included from configuration file, so if configuration file is empty nothing in /etc/logrotate.d is used. Unless you have different invocation of logrotate somewhere.
And "logrotate.conf" is rather useless because it is unknown where this file is located. Is it /etc/logrotate.conf? Or /tmp/logrotate.conf? Or somewhere else?
"/etc/logrotate.conf" While I take your point, it would be rather rash for a relative newbie to be so bold as to change it's default location.
Before delving any further
I wanted to assure or disabuse myself of the notion that it matters not, as long as the proper configurations are in /etc/logrotate.d/def_for_my_log.
In any event results from logrotate -vd /etc/logrotate.d/fetchmail seems to agree with my hopes and dreams and tells me the log needs to be rotated. We shall see if it does that when it runs just after midnight or if I need to tinker further. joe a.
On 2022-08-08 19:57, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
Then you should reinstall logrotate. Something or somebody deleted it. -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 8/10/2022 6:25 AM, Carlos E. R. wrote:
On 2022-08-08 19:57, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
Then you should reinstall logrotate. Something or somebody deleted it.
Updated logrotate via YAST, but /etc/logrotate.conf was not touched. I have simply added a line "include /etc/logrotate.d/" and will wait for the timer to run logrotate at the normal time. Seems too fraught with potential missteps to alter the timer to run it sooner. joe a.
On 2022-08-10 16:37, joe a wrote:
On 8/10/2022 6:25 AM, Carlos E. R. wrote:
On 2022-08-08 19:57, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
Then you should reinstall logrotate. Something or somebody deleted it.
Updated logrotate via YAST, but /etc/logrotate.conf was not touched.
If it was not touched, means the file exists. The installation surely created /etc/logrotate.conf.rpmnew. So compare both files, and copy over the rest. You can do that with "meld". -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 8/10/2022 11:36 AM, Carlos E. R. wrote:
On 2022-08-10 16:37, joe a wrote:
On 8/10/2022 6:25 AM, Carlos E. R. wrote:
On 2022-08-08 19:57, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
Then you should reinstall logrotate. Something or somebody deleted it.
Updated logrotate via YAST, but /etc/logrotate.conf was not touched.
If it was not touched, means the file exists. The installation surely created /etc/logrotate.conf.rpmnew. So compare both files, and copy over the rest. You can do that with "meld".
Did not find file: /etc/logrotate.conf.rpmnew. After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
* joe a <joea-lists@j4computers.com> [08-10-22 17:33]:
On 8/10/2022 11:36 AM, Carlos E. R. wrote:
On 2022-08-10 16:37, joe a wrote:
On 8/10/2022 6:25 AM, Carlos E. R. wrote:
On 2022-08-08 19:57, joe a wrote:
Leap 15.3.
Some time back got logrotate working to rotate fetchmail logs. Found that it seems to be no longer rotating that file.
I noticed the logrotate.conf file is empty.
Then you should reinstall logrotate. Something or somebody deleted it.
Updated logrotate via YAST, but /etc/logrotate.conf was not touched.
If it was not touched, means the file exists. The installation surely created /etc/logrotate.conf.rpmnew. So compare both files, and copy over the rest. You can do that with "meld".
Did not find file: /etc/logrotate.conf.rpmnew.
After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
logrotate.conf is in /usr/etc/logrotate.conf, maybe -- (paka)Patrick Shanahan Plainfield, Indiana, USA @ptilopteri http://en.opensuse.org openSUSE Community Member facebook/ptilopteri Photos: http://wahoo.no-ip.org/piwigo paka @ IRCnet oftc
Patrick Shanahan wrote:
* joe a <joea-lists@j4computers.com> [08-10-22 17:33]:
After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
logrotate.conf is in /usr/etc/logrotate.conf, maybe
Joe started out saying "Leap 15.3", so most likely not. Including /etc/logrotate.d is certainly a good idea, that dir contains the spec of when and what should be rotated - the default /etc/logrotate.conf only adds some defaults. -- Per Jessen, Zürich (20.4°C)
On 2022-08-11 09:32, Per Jessen wrote:
Patrick Shanahan wrote:
* joe a <joea-lists@j4computers.com> [08-10-22 17:33]:
After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
logrotate.conf is in /usr/etc/logrotate.conf, maybe
Joe started out saying "Leap 15.3", so most likely not.
Including /etc/logrotate.d is certainly a good idea, that dir contains the spec of when and what should be rotated - the default /etc/logrotate.conf only adds some defaults.
Yes, but the file is required. That file includes the directories manually, otherwise the tool does nothing at all. If it is not in ...rpmnew the installation should have created some other name. Anyway, I looked inside the rpm (logrotate-3.13.0-150000.4.7.1.x86_64.rpm from repo-sle-update). The file is this: # see "man logrotate" for details # rotate log files weekly weekly # keep 4 weeks worth of backlogs rotate 4 # create new (empty) log files after rotating old ones create # use date as a suffix of the rotated file dateext # uncomment this if you want your log files compressed compress # comment these to switch compression to use gzip or another # compression scheme compresscmd /usr/bin/xz uncompresscmd /usr/bin/xzdec # RPM packages drop log rotation information into this directory include /etc/logrotate.d -- Cheers / Saludos, Carlos E. R. (from 15.3 x86_64 at Telcontar)
On 8/11/2022 6:27 AM, Carlos E. R. wrote:
On 2022-08-11 09:32, Per Jessen wrote:
Patrick Shanahan wrote:
* joe a <joea-lists@j4computers.com> [08-10-22 17:33]:
After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
logrotate.conf is in /usr/etc/logrotate.conf, maybe
Joe started out saying "Leap 15.3", so most likely not.
Including /etc/logrotate.d is certainly a good idea, that dir contains the spec of when and what should be rotated - the default /etc/logrotate.conf only adds some defaults.
Yes, but the file is required. That file includes the directories manually, otherwise the tool does nothing at all.
If it is not in ...rpmnew the installation should have created some other name.
Anyway, I looked inside the rpm (logrotate-3.13.0-150000.4.7.1.x86_64.rpm from repo-sle-update). The file is this:
# see "man logrotate" for details # rotate log files weekly weekly
# keep 4 weeks worth of backlogs rotate 4
# create new (empty) log files after rotating old ones create
# use date as a suffix of the rotated file dateext
# uncomment this if you want your log files compressed compress
# comment these to switch compression to use gzip or another # compression scheme compresscmd /usr/bin/xz uncompresscmd /usr/bin/xzdec
# RPM packages drop log rotation information into this directory include /etc/logrotate.d
As noted in another reply, powered on a recent Leap 15.3 test box and found /etc/logrotate.conf was populated, complete with comments. I'll just copy or emulate that one I suppose.
On 8/11/2022 3:32 AM, Per Jessen wrote:
Patrick Shanahan wrote:
* joe a <joea-lists@j4computers.com> [08-10-22 17:33]:
After some further testing with includes in /etc/logrotate.conf and running logrotate in debug mode I am confident it will compress logs as expected when it runs this evening.
logrotate.conf is in /usr/etc/logrotate.conf, maybe
Joe started out saying "Leap 15.3", so most likely not.
Including /etc/logrotate.d is certainly a good idea, that dir contains the spec of when and what should be rotated - the default /etc/logrotate.conf only adds some defaults.
As noted in another reply, powered on a recent Leap 15.3 test box and found /etc/logrotate.conf was populated, complete with comments. I'll just copy or emulate that one I suppose.
participants (5)
-
Andrei Borzenkov
-
Carlos E. R.
-
joe a
-
Patrick Shanahan
-
Per Jessen