[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Script to email details not working in cron



Hi, 

I couldn't find why the script is not working in cron. Just replaced the crontab entry with the following and it worked

* 9 * * * /bin/bash /user/bin/email-script

Thanks everyone for your help. 

Regards,
Mani



On Fri, Jan 2, 2015 at 9:13 PM, Don Armstrong <don@debian.org> wrote:
On Fri, 02 Jan 2015, Manikandan M wrote:
> I have written a small script to email (using ssmpt) some details, and
> scheduled it in crontab. The script is running as per time mentioned in the
> cron but ssmtp is not sending the mail. please find the details below.
>
> user@host ~ $ cat bin/email-script
> /home/user/bin/actual-script > ~/details-file
> ssmtp username@gmail.com < ~/details-file
> echo $? > ~/email-status
>
> The crontab entry is as below
> 0 9 * * * /home/user/email-script

If this is actually the script,

1) It's missing #!/bin/sh or #!/bin/bash

2) It's in /home/user/bin/email-script, not /home/user/email-script

3) It may not be executable.

--
Don Armstrong                      http://www.donarmstrong.com

life's not a paragraph
And death i think is no parenthesis
 -- e.e. cummings "Four VII" _is 5_


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: [🔎] 20150102211336.GB29895@teltox.donarmstrong.com" target="_blank">https://lists.debian.org/[🔎] 20150102211336.GB29895@teltox.donarmstrong.com



Reply to: