Easiest way to get count val from mysql in bash -
maybe should use python or perl dont know any.
i have 4 statements , check if there errors longer hour. user setup dont need enter mysql user/pass. statement in mysql_webapp_error_check.sh
#!/bin/bash mysql testdb -e "select count(*) tbl last_error_date < date_sub(now(), interval 1 hour);"
how make give me return value (count(*)) instead of printing screen?
then i'll write if statement , output stdout/err cron use email me (otherwise want script silent nothing emailed unless theres problem)
#!/bin/bash echo show databases\; | mysql -u root | (while read x; echo "$x" y="$x" done echo "$y" )
Comments
Post a Comment