* cron: mail with subject?
@ 2002-04-02 15:35 Thomas Anders
2002-04-04 11:37 ` Thomas Voegeli
2002-04-09 19:36 ` Peter da Silva
0 siblings, 2 replies; 5+ messages in thread
From: Thomas Anders @ 2002-04-02 15:35 UTC (permalink / raw)
Unfortunately the output of a cron job gets mailed with an empty
subject line by default. Is there a way to globally change this
behaviour in Tru64 Unix 5.1A without doing a "mailx -s" (or similar)
in every single cron job?
Kind regards,
Thomas
--
Thomas Anders <anders@hmi.de>
Hahn-Meitner-Institut Berlin, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron: mail with subject?
2002-04-02 15:35 cron: mail with subject? Thomas Anders
@ 2002-04-04 11:37 ` Thomas Voegeli
2002-04-08 9:19 ` Thomas Anders
2002-04-09 19:36 ` Peter da Silva
1 sibling, 1 reply; 5+ messages in thread
From: Thomas Voegeli @ 2002-04-04 11:37 UTC (permalink / raw)
To: Thomas Anders
Hi Thomas
Try this:
* * * * * echo "Subject: blablabla"; unix_command_to_execute"
Greetings,
Thomas
Thomas Anders wrote:
> Unfortunately the output of a cron job gets mailed with an empty
> subject line by default. Is there a way to globally change this
> behaviour in Tru64 Unix 5.1A without doing a "mailx -s" (or similar)
> in every single cron job?
>
>
> Kind regards,
> Thomas
>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron: mail with subject?
2002-04-04 11:37 ` Thomas Voegeli
@ 2002-04-08 9:19 ` Thomas Anders
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Anders @ 2002-04-08 9:19 UTC (permalink / raw)
Thomas Voegeli <tv.pop@NOSPAMzuvrz.unizh.ch> writes:
> > Unfortunately the output of a cron job gets mailed with an empty
> > subject line by default. Is there a way to globally change this
> > behaviour in Tru64 Unix 5.1A without doing a "mailx -s" (or similar)
> > in every single cron job?
>
> Try this:
>
> * * * * * echo "Subject: blablabla"; unix_command_to_execute"
Not quite what I want. Your suggestion implies:
- touching every single cron job line
- getting mail for _every_ cron job, even those without output
Kind regards,
Thomas
--
Thomas Anders <anders@hmi.de>
Hahn-Meitner-Institut Berlin, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: cron: mail with subject?
2002-04-02 15:35 cron: mail with subject? Thomas Anders
2002-04-04 11:37 ` Thomas Voegeli
@ 2002-04-09 19:36 ` Peter da Silva
2002-04-18 9:09 ` Thomas Anders
1 sibling, 1 reply; 5+ messages in thread
From: Peter da Silva @ 2002-04-09 19:36 UTC (permalink / raw)
In article <0rn0wmxgdk.fsf@display.hmi.de>,
Thomas Anders <anders@hmi.de> wrote:
> Unfortunately the output of a cron job gets mailed with an empty
> subject line by default. Is there a way to globally change this
> behaviour in Tru64 Unix 5.1A without doing a "mailx -s" (or similar)
> in every single cron job?
Two solutions:
1. Cron sends mail by calling /usr/bin/mail explicitly. Rename that to
/usr/bin/mail.real and create a new "/usr/bin/mail" that looks for
the line "Cron: The previous message is the standard output" and
does whatever it is you want instead.
2. Replace cron with one of the Open Source versions, such as this
one: http://freshmeat.net/projects/dcron/?topic_id=141 and you
can change its behaviour any way you want.
--
`-_-' In hoc signo hack, Peter da Silva.
'U` "A well-rounded geek should be able to geek about anything."
-- nicolai@esperi.org
Disclaimer: WWFD?
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: cron: mail with subject?
2002-04-09 19:36 ` Peter da Silva
@ 2002-04-18 9:09 ` Thomas Anders
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Anders @ 2002-04-18 9:09 UTC (permalink / raw)
peter@abbnm.com (Peter da Silva) writes:
> Thomas Anders <anders@hmi.de> wrote:
> > Unfortunately the output of a cron job gets mailed with an empty
> > subject line by default. Is there a way to globally change this
> > behaviour in Tru64 Unix 5.1A without doing a "mailx -s" (or similar)
> > in every single cron job?
>
> Two solutions:
>
> 1. Cron sends mail by calling /usr/bin/mail explicitly. Rename that to
> /usr/bin/mail.real and create a new "/usr/bin/mail" that looks for
> the line "Cron: The previous message is the standard output" and
> does whatever it is you want instead.
>
> 2. Replace cron with one of the Open Source versions, such as this
> one: http://freshmeat.net/projects/dcron/?topic_id=141 and you
> can change its behaviour any way you want.
What I ended up doing was similar to 1., but the other way around
to not (potentially) break other programs using /usr/bin/mail:
1. edit /usr/sbin/cron to change the string "/usr/bin/mail" to
"/foo/bin/mail" (two times; use Emacs hexl-mode or replace)
2. create a shell script /foo/bin/mail like this:
#/bin/sh
(echo "Subject: `hostname` cron output"; cat -) | /usr/bin/mail ${1+"$@"}
Well, I was trying to avoid these sort of things ;)
Kind regards,
Thomas
--
Thomas Anders <anders@hmi.de>
Hahn-Meitner-Institut Berlin, Germany
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2002-04-18 9:09 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-04-02 15:35 cron: mail with subject? Thomas Anders
2002-04-04 11:37 ` Thomas Voegeli
2002-04-08 9:19 ` Thomas Anders
2002-04-09 19:36 ` Peter da Silva
2002-04-18 9:09 ` Thomas Anders
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox