cat /etc/logrotate.d/syslog
...
/var/log/messages {
daily
compress
dateext
dateformat "-%Y%m%d-%s"
maxage 90
rotate 90
missingok
notifempty
size +4096k
create 644 root root
sharedscripts
postrotate
/etc/init.d/syslog reload
endscript
}
...
SERVER:/var/log # /usr/sbin/logrotate /etc/logrotate.conf >/dev/null
error: syslog:21 unknown option 'dateformat' -- ignoring line
error: syslog:21 unexpected text
error: destination /var/log/messages-20141002.gz already exists, skipping rotation
SERVER:/var/log #
Q: on a SLES10, how can I set the dateformat option in the logrotate config file to have not only the YYYYMMDD format in the rotated filesnames, rather it should also have additional thing, hour or minute or any unique.
The problem is that it needs to be rotated more than one time per day, so using the day isn't OK, since "already exists"..
updated:
SERVER:~ # rpm -qa|grep -i ^logrotate
logrotate-3.7.3-13.17.1
SERVER:~ #