#vim/etc/mail.rc
Add the following two lines at the end of the document
Set from=***@163.com smtp=smtp.163.com
Set smtp-auth-user=***@163.com smtp-auth-password=*** Smtp-auth=login
The following line of command tests can be added to send mail to * * * @qq. com
#cat/etc/passwd | Mail-s "System statue" [email protected]
#vim/root/space.sh
Mail-s "System Status" [email protected] << EOF
' Echo '-----------MySQL data space use-----------"
Du-h/mydata
echo "-----------Home data space use-----------"
Du-h/home-d 1
echo "-----------CPU load-----------"
Uptime
echo "----------Who's login----------"
W.H.O.
echo "----------Mem swap-----------"
Free-h '
Eof
Preparing scheduled execution tasks
#vim/etc/crontab
Add the following line at the end of the document, one at a time per day
0 1 * * * Root sh/root/spaceuse.sh
The effect is as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6F/2D/wKiom1WTpNODUZyrAAM1CPRJL-w420.jpg "title=" Qq20150701162710.jpg "alt=" Wkiom1wtpnoduzyraam1cprjl-w420.jpg "/>
This article is from the "Linux" blog, so be sure to keep this source http://maolinux.blog.51cto.com/2131264/1669804
Centos7 sending Linux system status via mail timing