> Date: Sat, 2 Aug 2014 00:54:07 +0100
> From: Ken Moffat <[email protected]>
> To: [email protected]
> Subject: [blfs-dev] /etc/logrotate.conf nomail option
>
> I'm just updating my build scripts. For years I have used a simple
> script to do log rotation, so now I am going to try the logrotate
> package. Looking at the creation of /etc/logrotate.conf we have the
> following:
>
> # Don't send mail to anybody
> nomail
>
> I read that comment as "logrotate should not send mail about its
> operation to anybody", which is not necessarily what I want
> (although I think I'm going to get a report from fcron). But looking
> at an online manpage, and the link to techrepublic.com, the command
> appears to mean "Do not mail old logs (which are about to be deleted)
> to anybody" and that is proobably what I want.
>
> Am I right that the comment is misleading, or have I misunderstood
> it ?
>
What behaviour _do_ you want?
'nomail' means the opposite sense of the 'mail' directive (ref excerpt
from man-page, below).
Here, for example, we'd normally use, in /etc/logrotate.conf , as
belts'n'braces additional backup for logfiles:
----
mail eml_addr_userpart@eml_addr_dompart
maillast
----
If instead I wanted to nail-down logrotate to not send email at all for
either of the 'mailfirst' or 'maillast' senses, then I'd use 'nomail'
by itself.
Note that logrotate can have nested, hierarchical definitions/contexts
in the cfg file, with deeper-nested definitions taking precedence: so you
can use e.g. 'nomail' globally, but override it for a sub-section.
The mail/nomail settings for logrotate, don't affect the usual
cron emailed reports. Although, you _could_ use logrotate's
p{re,ost}rotate/{fir,la}staction/&c directives, to mess about with such
cron stuff if you wanted, for whatever reason.
Ref: As da man says:
----
mail address
When a log is rotated out-of-existence, it is mailed to address. If
no mail should be generated by a particular log, the nomail directive
may be used.
mailfirst
When using the mail command, mail the just-rotated file, instead of the
about-to-expire file.
maillast
When using the mail command, mail the about-to-expire file, instead of
the just-rotated file (this is the default).
nomail
Don't mail old log files to any address.
----
rgds,
akh
--
--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page