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 you


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 you