Stack Exchange Network
Stack Exchange network consists of 181 Q&A communities including
Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
The best answers are voted up and rise to the top
7 years, 10 months ago
This question already has answers here:
7 years ago.
I have a shell script which sends email when the disk is more than 80% full; when I run the script as
sh -x script.sh or
./script.sh I get an email but when I keep the script in cronjob I do not get any email.
The script has execute permissions (755).
When I type
mail I can see the cronjob has ran at that time, but there is no email sent.
28k 19 19 gold badges 87 87 silver badges 128 128 bronze badges
Aug 5, 2015 at 5:57
63 1 1 gold badge 2 2 silver badges 5 5 bronze badges
You can do 2 things.
Put the full path in for sendmail.
/usr/sbin/sendmail for example.
Put the following commands at the beginning of you crontab:
Aug 5, 2015 at 6:55
891 9 9 silver badges 19 19 bronze badges
Not the answer you're looking for? Browse other questions tagged
By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our
Accept all cookies
Necessary cookies only