sendmail command with cron job.

  • Thread starter Thread starter kunalks
  • Start date Start date
K

kunalks

a=$(df -h /mnt/smb | tail -n +3 | tr -s ' ' | tr '%' ' ' | cut -d ' ' -f 5)
echo $a

if [[ $a -ge 30 ]]; then
cat /etc/diskspace/text.txt | sendmail test.gmail.com
fi

Hallo guys
this is my script and everyhing is working so well acording to my need. i just have one question.

I want to run this script via cronjob. like every Minutes.

(* * * * * (. /etc/diskspacae/vpndrive.sh)#--Cron job command.

As you can see that i want to perform sendmail command that afte running this script if drive space is more than 80%, i get notification in my email .

But i dont get it when i run this script for cron tab.
and get this error msg in var/spool/mail /root.

ERROR Messae: /etc/diskspace/vpndrive.sh line 34 : sendmail: command not found.

any guess please ?

Continue reading...
 
Back
Top