1851072 Members
7379 Online
104056 Solutions
New Discussion

Re: Crontab and mailx

 
SOLVED
Go to solution
Iqbal Khan_2
Advisor

Crontab and mailx

Hello all,
When executing a job from the shell and outputting the output to mailx (cat /job | mailx ???s subject mailaddress.com) I get the output as an attachment. I then setup the same job to execute from cron and was unable to get the output as an attachment.
Appreciate all feedback.
Thanks
5 REPLIES 5
Craig Rants
Honored Contributor
Solution

Re: Crontab and mailx

One thing to remember about cron is that you should always put the absolute path in all your cron entries. cron has no $PATH, so that would be the first place to start. Change your entry and see what happens.

GL,
C
"In theory, there is no difference between theory and practice. But, in practice, there is. " Jan L.A. van de Snepscheut
Andi Rigauer
Regular Advisor

Re: Crontab and mailx

Hi ,

try this:

mailx ???s subject mailaddress.com < /job
god, root where's the difference
Deshpande Prashant
Honored Contributor

Re: Crontab and mailx

Hi
For running from cron give full path foe all commands.
I would use
#/sbin/cat /tmp/testfile |/usr/bin/mailx -s "Subject of email" EMAIL-ADDRESS.


Thanks.
Prashant Deshpande.
Take it as it comes.
F Verschuren
Esteemed Contributor

Re: Crontab and mailx

This is what help for me:

#! /usr/bin/sh
/sbin/cat /tmp/testfile |/usr/bin/mailx -s "Subject of email" EMAIL@ADDRESS

hth,