最後行添加
vi /root/.bashrc
dateTime=`date +%Y%m%d-%H:%M`
echo "root login" |mail -s "$dateTime root login" [email protected]