Answer the question
In order to leave comments, you need to log in
Bash, how to mail result?
Good evening, how to send the result of the request by mail?
now it stores in the home directory
Answer the question
In order to leave comments, you need to log in
supposed to work
mysql -u root -pPAssword -E "zabbix" -e "select * from hosts;" | mail (...тут параметры утилиты mail, гугли или man mail в помощь)
here is a working version
echo SQL DUMP `date +%D-%H:%M:%S` |mail -s "[sqldump]" -A /etc/passwd [email protected]
parameter -A - specifies the file that should be attachment.
and don't forget to gzip the sql code before sending
Choice:
metasend -b -s "$SUBJECT" -f $TXTFILE -m text/plain -e none -n -f $ATTFILE -m application/octet-stream -e base64 -t $MAILTO
mpack -s "$SUBJECT" -c application/octet-stream $ATTFILE $MAILTO
mutt -a $ATTFILE -s "$SUBJECT" $MAILTO < $TXTFILE
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question