Monday, November 23, 2009

[nslu2-linux] Re: [openslug] Send mail with nail in crontab

 

On my slugos 5.3 sendmail is in /usr/sbin. So try the following

# find / -name sendmail -print

if it show up in /usr/sbin/sendmail then do
ln -s /usr/sbin/sendmail /usr/lib/sendmail

Replace /usr/sbin/sendmail with the path to the one you find. Then try again.

/usr/lib/sendmail is a "well known" location for sendmail and it's common for even non-sendmail based mail systems put a fake one there so programs can find it.

Steve

--- In nslu2-linux@yahoogroups.com, "tkayna" <tkayna@...> wrote:
>
> Thanks,
>
> It returns me this :
> $ cat /tmp/myLog.err
> /usr/lib/sendmail: No such file or directory
> . . . message not sent.
>
> And I have this in nail bin :
> $strings /usr/bin/nail | grep sendmail
> sendmail
> /usr/lib/sendmail
>
> But I don't understand why it works in shell.
>
> Thank you for your help
>
> --- In nslu2-linux@yahoogroups.com, "rolandkbs" <roland.krebs@> wrote:
> >
> > I don't see the cause, but maybe I can help you to find it:
> > Add to the end of your crontab line the following
> > >/tmp/myLog.out 2>/tmp/myLog.err
> >
> > By inspecting the two files after the defined time has passed you will most probably find the problem.
> >
> > regards, Roland
> >
> > --- In nslu2-linux@yahoogroups.com, "tkayna" <tkayna@> wrote:
> > >
> > > Hello,
> > >
> > > I made un script to send mail.
> > > My script works executing in shell but not in crontab.
> > > I also add full path for binaries but it's the same.
> > >
> > > Can someone help me ?
> > >
> > > ***BASH SCRIPT send_mail.sh :
> > >
> > > #!/opt/bin/bash
> > >
> > > nail='/usr/bin/nail'
> > > sleep='/bin/sleep'
> > > echo='/bin/echo'
> > >
> > >
> > > function mail_status ()
> > > {
> > > ${sleep} 1
> > > ${echo} $1 $2 | ${nail} -s "save_sites_SQL_$1_$2" myemail@;
> > > #echo $? > /tmp/testestest_sendmail.txt
> > > }
> > >
> > > #### DEBUG TESTS ####
> > >
> > > mail_status "Test" "succes";
> > >
> > > ***CRONTAB LINE :
> > >
> > > 33 23 * * * /opt/bin/bash /temp/testmail/send_mail.sh
> > >
> >
>

__._,_.___
.

__,_._,___

No comments:

Post a Comment