PDA

View Full Version : SLES 10 & cron emails



afera
28-Oct-2011, 17:36
I receive emails daily with title "cronjob@myserver- daily - OK" but I
do not receive emails from cronjobs that make output.

to check if everything is ok I did two entires in /etc/crontab

*/5 * * * * root echo "test"
*/5 * * * * root echo "test" >> /var/log/test


both entries are executed by cron. The second one adds every five
minutes "test" to the test file in /var/log
however i would expect the first one to send the output to email
specified in MAILTO but it do not.

any idea why ?


--
afera
------------------------------------------------------------------------
afera's Profile: http://forums.novell.com/member.php?userid=98994
View this thread: http://forums.novell.com/showthread.php?t=447485

malcolmlewis
28-Oct-2011, 18:13
On Fri, 28 Oct 2011 16:36:02 GMT
afera <afera@no-mx.forums.novell.com> wrote:

>
> I receive emails daily with title "cronjob@myserver- daily - OK" but I
> do not receive emails from cronjobs that make output.
>
> to check if everything is ok I did two entires in /etc/crontab
>
> */5 * * * * root echo "test"
> */5 * * * * root echo "test" >> /var/log/test
>
>
> both entries are executed by cron. The second one adds every five
> minutes "test" to the test file in /var/log
> however i would expect the first one to send the output to email
> specified in MAILTO but it do not.
>
> any idea why ?
>
>
Hi
Make sure you have the full path to any applications as cron doesn't
know any environment like /bin /usr/bin etc.

--
Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
up 14:00, 4 users, load average: 0.00, 0.04, 0.05
GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09

afera
28-Oct-2011, 19:16
malcolmlewis;2149846 Wrote:
> On Fri, 28 Oct 2011 16:36:02 GMT
> afera <afera@no-mx.forums.novell.com> wrote:
>
> >
> > I receive emails daily with title "cronjob@myserver- daily - OK" but
> I
> > do not receive emails from cronjobs that make output.
> >
> > to check if everything is ok I did two entires in /etc/crontab
> >
> > */5 * * * * root echo "test"
> > */5 * * * * root echo "test" >> /var/log/test
> >
> >
> > both entries are executed by cron. The second one adds every five
> > minutes "test" to the test file in /var/log
> > however i would expect the first one to send the output to email
> > specified in MAILTO but it do not.
> >
> > any idea why ?
> >
> >
> Hi
> Make sure you have the full path to any applications as cron doesn't
> know any environment like /bin /usr/bin etc.
>
> --
> Cheers Malcolm °¿° (Linux Counter #276890)
> openSUSE 11.4 (x86_64) Kernel 2.6.37.6-0.7-desktop
> up 14:00, 4 users, load average: 0.00, 0.04, 0.05
> GPU GeForce 8600 GTS Silent - Driver Version: 285.05.09


case solved.

crontab uses sendmail to send mails which is most likely hardcoded into
cron.
emails send by the daily cronjobs uses mail command (what can be found
in /usr/lib/cron/run-crons script)


quite confusing. still cannot understand why suse expect to have mail
server to send simple emails instead of just having email client for
this.
I've changed postfix into ssmtp finally which took me time as this is
not available in suse as normal rpm packet..


--
afera
------------------------------------------------------------------------
afera's Profile: http://forums.novell.com/member.php?userid=98994
View this thread: http://forums.novell.com/showthread.php?t=447485

Thorsten Kampe
29-Oct-2011, 09:25
* malcolmlewis (Fri, 28 Oct 2011 17:13:20 GMT)
> Make sure you have the full path to any applications as cron doesn't
> know any environment like /bin /usr/bin etc.

??? Of course cron has a default PATH setting. You can even specify your
own in crontab.

Thorsten