# Log rotation

**URL:** <https://forums.percona.com/t/log-rotation/7038>\
**Category:** PMM 1.x\
**Created:** [May 29, 2019, 8:22am UTC](https://forums.percona.com/t/log-rotation/7038 "2019-05-29T08:22:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jadestorm](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jadestorm/32/1165_2.png) [@jadestorm](https://forums.percona.com/u/jadestorm)\
**Post date:** [May 29, 2019, 8:22am UTC](https://forums.percona.com/t/log-rotation/7038/1 "2019-05-29T08:22:42Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![rpedrero](https://avatars.discourse-cdn.com/v4/letter/r/57b2e6/32.png) [@rpedrero](https://forums.percona.com/u/rpedrero)\
**Post date:** [May 31, 2019, 2:03am UTC](https://forums.percona.com/t/log-rotation/7038/2 "2019-05-31T02:03:25Z")

</div>

You can add these options:  
copytruncate  
create 644 root root
