centos7 regularly sent by mail linux system status

#vim /etc/mail.rc
Document add the following two lines
set from=***@163.com smtp=smtp.163.com
set smtp-auth-user=***@163.com smtp-auth-password=*** smtp-auth=login
After the following line added please send mail to ***@QQ.com
#cat /etc/passwd | mail -s “system statue” 173056183@qq.cm
#vim /root/space.sh
mail -s “system status” 275807981@qq.com << 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 is login ———-“
who
echo “———- mem swap ———–“
free -h’
EOF
Scheduling tasks
#vim /etc/crontab
Finally, add the following line of the document, a point once a day
0 1 * * * root sh /root/spaceuse.sh
Results are as follows: