Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section Database Server
  • Search

logrotate mysqld errors Topic is solved

Questions regarding the Database Server
MySQL, PostgreSQL, MariaDB, Percona Server, phpMyAdmin, phpPgAdmin
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
chrisf
Posts: 49
Joined: Sat Oct 13, 2018 6:25 pm

Os: Ubuntu 16x
Web: apache + nginx
logrotate mysqld errors
  • Quote

Post by chrisf » Tue Oct 16, 2018 11:46 pm

I'm on Ubuntu 18.04, and I keep getting an email everynight saying logrotate failed due to:

/etc/cron.daily/logrotate: logrotate_script: 3: [: /var/run/mysqld/mysqld.pid: unexpected operator

I can't track this down... some help please?
Top

chrisf
Posts: 49
Joined: Sat Oct 13, 2018 6:25 pm

Os: Ubuntu 16x
Web: apache + nginx
Re: logrotate mysqld errors
  • Quote

Post by chrisf » Wed Oct 17, 2018 12:16 am

For further information I can run

logrotate /etc/logrotate.conf --debug

And there is no error. I can am unable to find this.

Hope for help. :-)
Top

chrisf
Posts: 49
Joined: Sat Oct 13, 2018 6:25 pm

Os: Ubuntu 16x
Web: apache + nginx
Re: logrotate mysqld errors
  • Quote

Post by chrisf » Wed Oct 17, 2018 1:04 am

For anyone else having this problem, I have to add it was MariaDB... not mysql 5.7

I figured it out.

In /etc/logrotate.d/mysql-server there was the line:

Code: Select all

my_print_defaults --mysqld | grep -oP "pid-file=\K[^$]+"
Which produces two matches, causing the error. Simple fix is m1 attribute added to grep:

Code: Select all

my_print_defaults --mysqld | grep -oPm1 "pid-file=\K[^$]+" 
Now all runs perfectly :-)
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Database Server”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password