Subject headers for crontab mail msgs?

Subject headers for crontab mail msgs?

Post by Seagu » Thu, 25 Jan 1996 04:00:00



: Is there a way to put subject headers in the mail messages
: that crontab sends?  That would be really helpful.  We
: get a dozen messages every day, and it's tedious to check
: for missing ones on all the machines.  

Not directly.  But what you _can_ do is write a wrapper script for
all of your cron jobs that does this for you.  At our site, we have
a wrapper called "cron.wrapper" (descriptive, isn't it?) that does
this, via the following arguments:

    cron.wrapper command mail_subject userlist ...

We then put this entry in cron for each job, and the wrapper executes
"command", and if there's output, it sends mail to "userlist" with a
subject of "subject" which describes the job so you can quickly scan
the output.

Cheers,
-+JLS
--
                               \  


http://www.aracnet.com/~seagull   \

 
 
 

Subject headers for crontab mail msgs?

Post by Geoff Alle » Thu, 25 Jan 1996 04:00:00



> Is there a way to put subject headers in the mail messages
> that crontab sends?  That would be really helpful.  We
> get a dozen messages every day, and it's tedious to check
> for missing ones on all the machines.  

The commands in my cron entries usually look something like:

  /path/to/some/command 2>&1 | /usr/bin/mailx -s"something descriptive here" geoff

(This is on HP/UX, where mailx is the barebones mailer that allows
specifying a subject.)

The key is that you don't want your cron command to produce any stdout
or stderr. Redirecting stderr to stdout and then piping both to a
mail program does the trick.

Geoff

--
Geoff Allen, WSU School of EE&CS sysadmin support guy.  Finger for PGP key.

___________________________________________________________________________
The Bible tells us to love our neighbors, and also to love our enemies;
probably because generally they are the same people.
               -- G. K. Chesterton

 
 
 

Subject headers for crontab mail msgs?

Post by John Nol » Thu, 25 Jan 1996 04:00:00


Is there a way to put subject headers in the mail messages
that crontab sends?  That would be really helpful.  We
get a dozen messages every day, and it's tedious to check
for missing ones on all the machines.  

Thanks for any help!  
--
###  John Nolan  


###  Drexel University, Philadelphia         ~      (_)/ (_)        

 
 
 

1. Subject headers for crontab mail msgs?

Is there a way to put subject headers in the mail messages
that crontab sends?  That would be really helpful.  We
get a dozen messages every day, and it's tedious to check
for missing ones on all the machines.  

Thanks for any help!  
--
###  John Nolan  


###  Drexel University, Philadelphia         ~      (_)/ (_)        

2. csh script

3. Apache 1.3.26 with multiple auth modules

4. test test test

5. Define subject in crontab mails

6. Wireless lease-line systems

7. Want to send mail with Subject header on SGI and DEC platforms

8. /usr/bin/msgs and permissions on /var/msgs

9. mail-command in crontab (Don't send empty mails)

10. system msgs (/var/msgs)

11. Getting Mail headers without mail prog???