*BSD News Article 70790


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.rmit.EDU.AU!news.unimelb.EDU.AU!munnari.OZ.AU!news.mel.connect.com.au!news.mira.net.au!inquo!in-news.erinet.com!imci5!pull-feed.internetmci.com!news.internetMCI.com!newsfeed.internetmci.com!uwm.edu!vixen.cso.uiuc.edu!ux5.cso.uiuc.edu!igor
From: igor@students.uiuc.edu (Igor Vladim Roshchin)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: Redirecting output of cron
Date: 12 Jun 1996 19:50:27 GMT
Organization: University of Illinois at Urbana
Lines: 30
Message-ID: <4pn723$8bn@vixen.cso.uiuc.edu>
References: <31bec05e.7376476@news.hq.af.mil>
NNTP-Posting-Host: ux5.cso.uiuc.edu
X-Newsreader: TIN [version 1.2 PL2]

Scott Gregory (sgregory@pubspo.hq.af.mil) wrote:
: Is it possible to have cron email the results of a script it ran sent
: to a list of users instead of root???

: I have cron checking to see if a file had been dropped by a user.
: When it sees the file it runs a script to process the file.  When it
: finishes it dumps all the screen output from the script to a mail
: message to root.  Is there any way to have this output mailed to the
: uses that need to know if the script processed???

: The script is in roots crontab since I want to control how often the
: system checks and the users aren't users of the bsd box, they drop the
: files into a NFS'ed directory.

: Thanks

: C-ya

: Scott

The script you are starting from your cron should be started as follows:

/path/script 2>&1 | sendmail allusers

where you can either make an alias to allusers (in /etc/aliases)
or just put down all the users you have.

IgoR

aka StR@komkon.org