I need to compress the files in var/log/remots/*/*
with the following logrotate rule
/var/log/remots/*/* {
rotate 178
daily
maxage 178
compress
}
located in /etc/logrotate.d/remots
.
I also have scripted and it looks like this.
cp rsyslog.conf /etc/rsyslog.conf
cp 10-remot.conf /etc/rsyslog.d/10-remot.conf
cp remots /etc/logrotate.d/remots
./rpgp.sh perms.txt
service rsyslog restart
However, when I force a logrotate with sudo logrotate -d --force /etc/logrotate.d/remots
the log remains as plain text, is not compressed. The ouput is like a lot of messages like
renaming /var/log/remots/GSX/2019-03-25.2.gz to /var/log/remots/GSX/2019-03-25.3.gz (rotatecount 178, logstart 1, i 2)
renaming /var/log/remots/GSX/2019-03-25.1.gz to /var/log/remots/GSX/2019-03-25.2.gz (rotatecount 178, logstart 1, i 1),
renaming /var/log/remots/GSX/2019-03-25.0.gz to /var/log/remots/GSX/2019-03-25.1.gz (rotatecount 178, logstart 1, i 0),
and finally
/var/log/remots/GSX/2019-03-25.179.gz doesnt' exist -- wont't you try to dispose of it
renaming /var/log/remots/GSX/2019-03-25 to /var/log/remots/GSX(2019-03-25.1
compressing log with: /bin/gzip
PD: 10-remots.conf looks like
$template GuardaRemots, "/var/log/remots/%HOSTNAME%/%timegenerated:1:10:date-rfc3339%"
:source, !isequal, "localhost" -? GuardaRemots
and rsyslog.conf is just configurated to listen via UDP port 514