Aside from storing log messages to specific files, I am trying to also compress them for archiving purposes. Logrotate will just rotate plain files.
The way I tried to solve this is by adding a template for each file. For example:
$OMFileZipLevel 6.
$template. MAILLOG,"/archive/%$YEAR%/%$MONTH%/%$DAY%/maillog.gz".
$OMFileZipLevel 6
$template MESSAGES,"/archive/%$YEAR%/%$MONTH%/%$DAY%/messages.gz".
*.emerg /var/logs/messages
& -?MESSAGES
local3.* /var/log/maillog
& -?MAILLOG
That works fine, however if I have twenty different files I will have to create 20 different templates and add the $OMFileZipLevel 3.
prior to each template.
Is there any other way to achieve these without repeating $OMFileZipLevel 3.
and by using a single template?
0 Answers