3

We have the following pronblem. Once in a while, our application server spits out an empty logfile or (when it's in the weekend), there is no logfile at all.

We use logrotate for managing these logfiles and in both cases, we want logrotate to skip trying to rotate the empty or non-existing logfiles, since it is cluttering out rt-ticket bin and Nagios, since logrotate barfs at me in such a case.

Is there any way to do this in logrotate (of course I can write a script that does exactly that (skipping the empty and non-existing onces_, but that's not my question)

1
  • I don\t get the -2, but maybe that's your way of saying RTFM Nov 11, 2014 at 6:23

1 Answer 1

8

These two logrotate.conf options might help you:

missingok If the log file is missing, go on to the next one without issuing an error message. See also nomissingok.

notifempty Do not rotate the log if it is empty (this overrides the ifempty option).

For more information, see man logrotate.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .