How to exclude a service under /etc/logrotate.d/ to run with the main logrotate job

Solution 1:

If you look at the manual man logrotate.conf, you can read find tabooext option which enables you to exclude some files with specific extensions.

tabooext [+] list
     The current taboo extension list is changed (see the include directive for information on the taboo extensions). If a + precedes the
     list of extensions, the current taboo extension list is augmented, otherwise it is replaced. At startup, the  taboo  extension list
     contains  .rpmsave,  .rpmorig,  ~, .disabled, .dpkg-old, .dpkg-dist, .dpkg-new, .dpkg-bak, .dpkg-del, .cfsaved, .ucf-old, .ucf-dist,
     .ucf-new, .rpmnew, .swp, .cfsaved, .rhn-cfg-tmp-*

You can choose one of the default excluded extensions like .disabled or you can specifiy your own additional extension like:

tabooext + .test

All you need to do is to rename your file /etc/logrotate.d/test to have any of these extensions like /etc/logrotate.d/test.disabled.

Solution 2:

You could edit the config file as below:

before

include /etc/logrotate.d

after

include /etc/logrotate.d/*.conf

This should make only files ending .conf in /etc/logrotate.d/ to be picked up by logrotate excluding your test file

If you already have files in /etc/logrotate.d/ being used by logrotate, these would need updated to include .conf