ini script nya :
#!/bin/bash
# script to send simple email
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# email subject
SUBJECT=”Cron Queue Check Arcana”
# recipient
EMAIL=”alert@mcs.co.id”
# Email text/message
EMAILMESSAGE=”/tmp/emailmessage.txt”
# command
exim -bpc > tot.txt
cek=$(cat tot.txt)
if [[ $cek == 0 ]]
then
echo “Halo Gan, antrian aman nampaknya sekian 86”
else
if [[ $cek -ge 50 ]]
then
echo “Halo Gan, dicek dong kayanya ada spam nih”
else
echo “Halo Gan, ko ngantri sih”
fi
fi > $EMAILMESSAGE
echo “” >> $EMAILMESSAGE
echo “Jumlah Queue : ” >> $EMAILMESSAGE
exim -bpc >> $EMAILMESSAGE
echo “” >> $EMAILMESSAGE
echo “list Queue : ” >> $EMAILMESSAGE
exim -bp | exiqsumm | egrep -v “\-\-|Volume|^$” | sort -bg | awk ‘{print “Volume: ” $1 ” \t Domain: ” $5}’ >> $EMAILMESSAGE
echo “” >> $EMAILMESSAGE
echo “Detail Queue : ” >> $EMAILMESSAGE
exim -bp >> $EMAILMESSAGE
# send an email using /bin/mail
/bin/mail -s “$SUBJECT” “$EMAIL” < $EMAILMESSAGE
lu taro dah..
ex : /usr/local/src/xxx/cek.sh
tambahin rule cron nya
crontab -e
tambahin paling belakang dah
0 * * * * /bin/bash /usr/local/src/dian/crot.sh > /dev/null 2>&1