Article 4TQPC Send by email the name of the database that has MyISAM tables

Send by email the name of the database that has MyISAM tables

by
bmxakias
from LinuxQuestions.org on (#4TQPC)
Hello

I am trying to create a script that will check all databases and if any of them has MyISAM tables to send me an email with the name of the database(s).

Now i have that:
Code:#!/bin/bash
EMAILALERT="email@gmail.com"
HOSTNAME="$(hostname)"
MYSQLDATADIR=$(mysqladmin var | grep 'datadir' | awk '{ print $4}')

if [[ "$(find ${MYSQLDATADIR} -type f -not -path "${MYSQLDATADIR}mysql/*" -name "*.MYD")" ]]; then
echo "Server has MyISAM tables in database" | mail -s "$HOSTNAME has MyISAM tables in database" $EMAILALERT
fiIt works as expected but i don't know how i can get the name(s) of the folder(s) of the database(s) on my email so i will know exactly which database has the MyISAM tables.

Need some help please.

Thank youlatest?d=yIl2AUoC8zA latest?i=QRXyqylMjyA:XuywPg4K-UQ:F7zBnMy latest?i=QRXyqylMjyA:XuywPg4K-UQ:V_sGLiP latest?d=qj6IDK7rITs latest?i=QRXyqylMjyA:XuywPg4K-UQ:gIN9vFwQRXyqylMjyA
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments