[SunHELP] simple query about "exec"

DAUBIGNE Sebastien - BOR sunhelp at sunhelp.org
Thu Nov 8 06:28:57 CST 2001


Actually there is no tty associated with any cron / at  jobs.
("ps -ef | grep cron" says "?" for TTY).

"/dev/tyy" only points to the tty associated with the=20
process session.

You should either redirect stdout/stderr to "/dev/null" =20
or to some file.
If you want your job to put messages on the console,=20
use "/dev/console" for stdout/stderr.


---
Sebastien DAUBIGNE=20
sebastien.daubigne at sema.fr <mailto:sebastien.daubigne at sema.fr>  - (+33)
(0)5.57.26.56.36
Sema Global Services - AFM/DW/Pessac

	-----Message d'origine-----
	De:	TAG DBA [SMTP:dbatag at tatainfotech.com]
	Date:	jeudi 8 novembre 2001 07:18
	=C0:	'sunhelp at sunhelp.org'
	Objet:	[SunHELP] simple query about "exec"

	This must be a real simple question - but I cant seem to figure this
out :
	In one of my scripts I redirect std o/p and std error to a file like
	this "
	exec >$LOGFILE 2>&1 =20
	And later I reset std error and std input back to the screen like
this :
	exec > /dev/tty 2>&1=20

	This works fine when I run the script from the command line - but
when I
	run it from cron , the second line gives this error :
	/scripts/doexp.sh[84]: /dev/tty: cannot create

	Perhaps there is no /dev/tty associated with a cron job - but then
how
	do I still get the script to dump std output and std error to where
it
	was originally going ?

	Thanks and Regards,
	~aslam
	_______________________________________________
	SunHELP maillist  -  SunHELP at sunhelp.org
	http://www.sunhelp.org/mailman/listinfo/sunhelp



More information about the SunHELP mailing list