On Wed, Nov 11, 2015 at 1:33 AM, Ajeesh Kannan <ajeeshbkan...@gmail.com> wrote: > H, > > i have added logrotate as follows, > > log.* { > daily > missingok > rotate 2 > dateext > dateformat %Y-%m-%d. > compress > maxage 40 > } > > But now the zipped logs are again and again zipping. > > .gz-20151011.gz2015-11-10..gz > > Can you check anything wrong in my logrotating
I don't think the above will work. "log.*" wildcard matches the compressed files also. So change the regex or specify the log file's complete name. Also, logrotate would need some finite amount of time to rename the current log file and replace it with a 0 length logfile for the daemon to log. If your daemon supports a SIGHUP, then it might be worhtwile to do a postrotate SIGHUP so that the daemon starts logging on the new file. Also, try delaycompress in conjuction with compress. For more details, RTFM "man logrotate." You may have to experiment with the logrotate options to get what you want. Just a thought, if your distro is a RHEL/derivative check for SELinux gotchas. It would be great if you could share your solution. HTH, -- Arun Khan _______________________________________________ ILUGC Mailing List: http://www.ae.iitm.ac.in/mailman/listinfo/ilugc ILUGC Mailing List Guidelines: http://ilugc.in/mailinglist-guidelines