I have crontab and a simple bash script that sends me emails every often containing PHP, NGINX, MYSQL errors from their log files. This is a simplified example.
#/home/user/status.sh
[email protected]
PHP_ERROR=`tail -5 /var/log/php-fpm/error.log`
NGINX_ERROR=`tail -5 /var/log/nginx/error.log`
MYSQL_ERROR=`tail /var/log/mysqld.log`
DISK_SPACE=`df -h`
echo "
Today's, server report::
==================================
DISK_SPACE: $DISK_SPACE
---------------------------------
MEMORY_USAGE: $MEMORY_USAGE
-----------------------------------
NGINX ERROR: $NGINX_ERROR
-----------------------------------
PHP ERRORS: $PHP_ERROR
------------------------------------
MYSQL_ERRORS: $MYSQL_ERROR
-------------------------------------
" | mail -s "Server reports" $EMAIL
I know this is a very basic usage, but as you can see, I am trying to separate the errors, but not of the html tags including \n are working.
So, my question is, is it possible to use HTML tags to format the text, if not .. then what are the alternatives.