/usr/lib/sendmail -t -io < file
반드시 /lib/밑에 있는 sendmail을 실행해야 한다.
/usr/sbin/sendmail과는 다른 sendmail이다.
cat file
To: kkang@hanmail.net
Subject: System check
위의 두줄은 반드시 들어가야 한다.
ex) disk_check.sh
echo =================================================== >>/home/web
echo CHECK_START_TIME `date +%Y%m%d-%k:%M` >> /home/web
echo =================================================== >> /home/web
echo Disk Check >> /home/web
echo ----------------------------- >>/home/web
df >> /home/web
echo ----------------------------- >> /home/web
echo Process Check >> /home/web
echo ----------------------------- >> /home/web
pstree >> /home/web
echo ----------------------------- >> /home/web
echo CPU Load Check >> /home/web
echo ----------------------------- >> /home/web
uptime >> /home/web
#/sbin/iptables -L >> /home/web
/usr/lib/sendmail -t -oi < web