Not the answer you need?
Register and ask your own question!

Log rotation

Hi folk! I've had a few of my servers slowly filling up /var/log as the pmm-*.log's (especially /var/log/pmm-linux-metrics) grow without bound. I'm setting up a simple logrotate config for them to take care of it but I wanted to make sure I'm not going to cause a loss of data, and if so, ask for some advice. =)

I don't know how familiar y'all are with logrotate, but my config is as follows:
/var/log/pmm-*.log {
compress
daily
missingok
notifempty
rotate 5
sharedscripts
dateext
postrotate
/sbin/pmm-admin restart --all
endscript
}

Effectively, move the old logs out of the way and compress them and then use pmm-admin to restart all of the services so they generate new logs. My concern is that I'm not sure exactly how the data from the logs are used. Am I potentially moving some data out of the way before it has a chance to get transferred to the PMM server node? If that's the case, any thoughts on how I could work around that?

Thanks!

Comments

  • rpedrerorpedrero Contributor Current User Role Novice
    You can add these options:
    copytruncate
    create 644 root root
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.