How can I set log rotate to, /var/log/messages files, all the files with the name "messages", rotate every 4 days (to keep last 4 files), not to generate any error messages??
/var/log/messsages-* { dateext maxage 3 rotate 4 missingok nocompress }
Is this correct?
No. Unless you are moving the files out of that directory with the
olddirdirective, you should never end your regex path with a wildcard:You will end up with an infinitely-repeating cycle of rotations. You do not need a wildcard at all in your directive definition.