Jump to content

Recommended Posts

Guest kunalks
Posted

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...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...