I need to build a report from the output of MySQL database check and auto-repair.
But dont want the full report each time : only in case of repair was needed
A scheduled (cron) a task runs mysqlcheck
I want to get informed by email of eventual repair needed, repair success, repair fails...
But dont want the full report each time : only repairs
I run the mysqlcheck like this:
mysqlcheck --user=myuser --password=mypwd -c --auto-repair dbname > ouput.log
Found on a blog that the mysqlcheck output may looks like this in case of repair
Repairing tables
dbname.table1
warning : Number of rows changed from 3 to 1
status : OK
dbname.table2
warning : Number of rows changed from 5454 to 5455
status : OK
dbname.table3
warning : Number of rows changed from 471859 to 471860
status : OK
Since i cant find any official documentation about how looks the exact output,
I need help to build a report text file made by processing the output of mysqlcheck.
Perhaps some regex magician can make a report giving repaired tables names, faillure notice and so.
This refers to the mysql server available on official Ubuntu repositories
mysql-server 5.7.25-0ubuntu0.18.04.2