# Logrotate script for percona 5.7 on ubuntu 16.04

**URL:** <https://forums.percona.com/t/logrotate-script-for-percona-5-7-on-ubuntu-16-04/6253>\
**Category:** Percona XtraDB Cluster 5.x\
**Created:** [March 15, 2018, 10:49am UTC](https://forums.percona.com/t/logrotate-script-for-percona-5-7-on-ubuntu-16-04/6253 "2018-03-15T10:49:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Yathus](https://avatars.discourse-cdn.com/v4/letter/y/b9e5f3/32.png) [@Yathus](https://forums.percona.com/u/Yathus)\
**Post date:** [March 15, 2018, 10:49am UTC](https://forums.percona.com/t/logrotate-script-for-percona-5-7-on-ubuntu-16-04/6253/1 "2018-03-15T10:49:11Z")

</div>

Hi,

After some weeks my /var/log/mysqld.log is huge (430Mb).

I was looking for the logrotate and i found this one :

/etc/logrotate.d/percona-xtradb-cluster-server-5.7

But it can’t work :

[IMG2=JSON]{“data-align”:“none”,“data-size”:“full”,“src”:“https://www.percona.com/forums/filedata/fetch?filedataid=1008&type=thumb”}[/IMG2]

It’s look like some package / script are not tested on Ubuntu ?

Best regards

Yathus

![photoid=51104](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/d/d94e94885051e69db250266e85c366dd52cef2e6.png)

 ![photoid=51105](https://us1.discourse-cdn.com/flex019/uploads/percona1/original/2X/e/ea9a5b45ea8025d3c961b667f50b4967a13b4638.png)

---

<div class="post-metadata">

**Author:** ![Big\_Boss](https://avatars.discourse-cdn.com/v4/letter/b/e56c9b/32.png) [@Big\_Boss](https://forums.percona.com/u/Big_Boss)\
**Post date:** [November 24, 2018, 6:21am UTC](https://forums.percona.com/t/logrotate-script-for-percona-5-7-on-ubuntu-16-04/6253/2 "2018-11-24T06:21:22Z")

</div>

First, let’s fix the bug in the Percona log rotate script:

```auto
sed -i 's#/var/log/mysql.log#/var/log/mysqld.log#' /etc/logrotate.d/percona-xtradb-cluster-server-5.7

```

From your screenshots, I can see you don’t have /etc/mysql/debian.cnf file, so either you don’t have the `debian-sys-maint` user in your database (then you should create one) or it is there but the file is only installed on the bootstrap node, if so do copy this file to all the cluster nodes.

> [@](#):
>
> Debian and Ubuntu installation doesn’t automatically create a special debian-sys-maint user which can be used by the control scripts to control the Percona Server mysqld and mysqld\_safe services like it was the case with previous Percona Serverversions. If you still require this user you’ll need to create it manually.

[https://www.percona.com/doc/percona-server/5.7/installation/apt\_repo.html](https://www.percona.com/doc/percona-server/5.7/installation/apt_repo.html)
