I have a script space_monitor.sh which when ran, will check the used and available disk space in a machine and if the space left is less than a threshold, it will send mail to some mail ids.

The script is running perfectly when I ran through command line.

But when I run it by creating a cron job. It is giving the following error

Mar 27 01:38:01 gudiwadap-udt cron[1497]: (ram) RELOAD (crontabs/ram)
Mar 27 01:38:01 gudiwadap-udt CRON[17802]: (ram) CMD (/home/ram/Desktop/Untitled_Folder/space_monitor.sh)
Mar 27 01:38:07 gudiwadap-udt sSMTP[17814]: RCPT TO:<ram@gudiwadap-udt.india.tejasnetworks.com> (550 5.7.1 Unable to relay)
Mar 27 01:38:07 gudiwadap-udt CRON[17801]: (ram) MAIL (mailed 1 byte of output; but got status 0x0001, #012)

I tried googling about this, but I could not find any issue online which matches my case.

The crontab entry for the script is

38 00-18 * * 1-5 /home/ram/Desktop/Untitled_Folder/space_monitor.sh

If I am not wrong, above cron job will run every weekday(mon to fri) for every hour from 00 to 18hrs exactly during 38th minute of the hour.

I was even specifying absolute paths to binaries such as echo, mail. I am not able to figure out what I am doing wrong.

EDIT System Details : Ubuntu Desktop 14.04

New contributor
ram914 is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    To start with, which version of Linux have you installed (Ubuntu server, Ubuntu desktop, Kubuntu, Lubuntu, Xubuntu, Ubuntu MATE, et al.) , and which release number? Are you using virtualization, and if so, which package? Please click edit and add that vital information to your question so all the facts we need are in the question. Please don't use Add Comment, since that's our channel to you. All facts about your system should go in the Question with edit – K7AAY Mar 26 at 20:28
  • 14.04 is EOL, and not supported anymore. – waltinator Mar 26 at 23:47
  • What command are you using to send email? How are the SMTP servers configured for it? – muru yesterday

Your Answer

ram914 is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.