sendmail スクリプトメモ

[root@cent5-64b-40 cron.daily]# pwd
/etc/cron.daily
[root@cent5-64b-40 cron.daily]# 
[root@cent5-64b-40 cron.daily]# cat send-mail.sh 
#!/bin/sh


echo "----- touch test flag touch /export/testflag "
touch /export/project/testflag



DAY=`date +%Y/%m/%d`
HOST=`uname -n`
MAIL=hirasawa@hirasawa.local
SUB=$HOST-----$DAY
mail -s $SUB $MAIL  << _EOF_
----------------- date-----------
`date +%Y/%m/%d`
`date`
----------------- uname -n-----------
`uname -n`
----------------- find /export -mtime -2 result-----------
`find /export -mtime -2`
------------------find /home -mtime -2 ressult  ----------
`find /home -mtime -2`
----------------- df result-----------
`df`
----------------- tail -40 /var/log/clamav/clamd.log result-----------
`tail -40 /var/log/clamav/clamd.log`
----------------- tail -40 /var/log/clamav/freshclam.log result-----------
`tail -40 /var/log/clamav/freshclam.log`

----------------- restart/halt result-----------
`cat /var/log/messages | grep -E "restart|halt" `
----------------------

_EOF_
[root@cent5-64b-40 cron.daily]#