Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: interactive vs cron called



On Thu, Dec 18, 1997 at 03:30:51PM -0500, Jason Zapman II wrote:
> Is there a way to tell if a script is being called by cron or via
> interactive script?  I'm writing something to tell me when disk usage of
> various partitions get's to dangerous levels.  When it's run via cron, I
> want it to mail me the results.  If it's interactive, I want it to print
> the output to the screen.
	why not just have it print output to screen, and in the crontab run the 
command through a pipe to a command-line mailer?
	alternately, write your script to accept a command line option to send 
you mail, and invoke the cron using that option.
	
	-- sweth.

-- 
"Countin' on a remedy I've counted on before
Goin' with a cure that's never failed me
What you call the disease
I call the remedy"  -- The Mighty Mighty Bosstones



Messages sorted by: Reverse Date, Date, Thread, Author