If you want to force-run a single specific directory or daemon's log files, you can usually find the configuration in /etc/logrotate.d
, and they will work standalone.
Keep in mind that global configuration specified in /etc/logrotate.conf
will not apply, so if you do this you should ensure you specify all the options you want in the /etc/logrotate.d/[servicename]
config file specifically.
You can try it out with -d
to see what would happen:
logrotate -df /etc/logrotate.d/nginx
Then you can run (using nginx as an example):
logrotate -f /etc/logrotate.d/nginx
And the nginx logs alone will be rotated.