A simple bash script to export the MySQL DB tables content into an HTML file.
Common use case: create a database with MySQL views you need to monitor and send the full content via mail as a report (see a linux cron table example below).
It can be easily modified to work with single tables if you need to, with an additional parameter, send a pull request in case
-
mysqldb2html
-
Pipe output into file
mysqldb2html dbname > /path/to/output.html
-
Crontab entry to mail db content into a midnight mail.
0 0 * * * /usr/local/bin/mysqldb2html yourdbname | mail -s 'database report' -a 'Content-Type: text/html' your@mail.com
chmod +x mysqldb2html/usr/local/bin/mysqldb2html
dpkg --build mysqldb2html/
wget https://github.com/elvisciotti/mysqldb2html/raw/master/mysqldb2html.deb
sudo dpkg -i mysqldb2html.deb