# Vim/etc/mail. rc adds the following two lines at the end of the document: setfrom = *** @ 163. comsmtp = smtp.163.comsetsmtp-auth-user = *** @ 163. comsmtp-auth-password = *** smtp-auth = a line of command below login to test whether an email can be sent to *** @ qq.com # cat
# Vim/etc/mail. rc
Add the following 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 tests whether an email can be sent 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
Prepare and execute tasks
# Vim/etc/crontab
Add the following line at the end of the document and execute it once a day
0 1 *** root sh/root/spaceuse. sh
The effect is as follows: