Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am logging all our applications logs to /logs/, where all our applications have an seperate directory. I have made a custom logrotate file as follows:

/logs/*.log {



rotate 1




So this is catching all logfiles within /logs. But i want to leave some directories out of the rotation. Can I somehow exclude these directories? And what would be the best practice in this situation?

share|improve this question
up vote 5 down vote accepted

The recommended location for log files is /var/log.

You can do some file globbing and multiple filespecs to specify what to include:

    log options

but it's better to create different files for each app and put them in /etc/logrotate.d and include only one or two filespecs in each that are associated in some way (e.g. app or function/purpose). Use the existing files in that directory as models.

share|improve this answer

Use wildcards sparingly. If I were you, I'd specify the logfiles of each application separately.

share|improve this answer

Short of doing evil glob syntax I don't think there's any obvious way.

The best way would be to switch to a conf file per app.

share|improve this answer

You can use globbing to do this:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.