kevandju
asked on
Bash script to email me data from MySQL on Linux server
I have a View that I created on my MySQL database that I would like emailed to me daily so I can monitor some data. I just have no idea on how to write a script to do this. Can anyone help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Sorry for the delay on responding. Arober is there a way that I can just have the results placed in the body of the email rather than an attachment?
#Attach the extracted file to an email, then delete it.
uuencode $TMP_FIR/$CSV_FL_NAME $CSV_FL_NAME |
Can be changed to
uuencode $TMP_FIR/$CSV_FL_NAME $CSV_FL_NAME;
mailx $MAILX_REP $REPLY_TO -s "$SUBJECT_LINE" $MAIL_TO < $CSV_FL_NAME;
uuencode $TMP_FIR/$CSV_FL_NAME $CSV_FL_NAME |
Can be changed to
uuencode $TMP_FIR/$CSV_FL_NAME $CSV_FL_NAME;
mailx $MAILX_REP $REPLY_TO -s "$SUBJECT_LINE" $MAIL_TO < $CSV_FL_NAME;
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
mail -s 'Daily DB Check - MySQL View' username@mail.domain.tld < /path/to/file