1. 程式人生 > >richard的專欄([email protecte

richard的專欄([email protecte

#!/bin/bash

time=`date -d yesterday +"%Y-%m-%d"`

/usr/bin/find  /data/mysql/apm-3306/log/ -name 'apm-slow-*' -mtime +7|xargs rm -rf ; mv /data/mysql/apm-3306/logslowquery_20181001.log /data/mysql/apm-3306/log/apm-slow-$time.log /usr/bin/mysqladmin -uroot   --socket=/data/mysql/apm-3306/mysql.sock flush-logs slow