Summary: Cron Job Output

From: Gregory G. Goldstein - Email: goldsteg@cna.org (goldsteg@cna.org)
Date: Fri Mar 22 1996 - 12:45:32 CST


As, always I want to thank everyone who responded. Just about everyone came up
with the same solution. Listed below is the question summary, answer, SUN Guru's
to thank, and the original post.

[=========================== Question Summary ===========================]
Why is my cron job dropping that last line of output?

[=========================== Answer ===========================]

The problem was that line was going to standard error output.
The gollowing line fixed the problem:
50 09 * * 0-6 /export/home/cnaadmin/telnet.csh 2>&1 | tee -i /export/home/cnaadmin/telnet.out

[=========================== Thanks To ===========================]
Darius_Terrell@khan.avalon.COM
Ken_Simpson@tmai.com
ca@informatik.uni-kiel.de
gerhard@jason.nl
qwe@ht.eimb.rssi.ru
dchu@winslo.ohio.gov
Glenn.Satchell@Uniq.com.au
antonio.colombo@amail.amdahl.com
fgreco@lehman.com
manjeet@iglou.com
[=========================== Original Question ===========================]

Situation:

When I run the following cron job it appears to be dropping the last line of
output. As demonstrated by the following:

$ crontab -l
50 09 * * 0-6 /export/home/cnaadmin/telnet.csh | tee -i /export/home/cnaadmin/telnet.out
51 09 * * 0-6 /usr/ucb/mail -s "Telnet Check" goldsteg@cna.org < /export/home/cnaadmin/telnet.out

The output in telnet.out looks like this:

Trying ###.###.###.# ...
Connected to xxxx.xxxx.xxxx.
Escape character is '^]'.
Connection closed by foreign host.

When I run the same command from the csh I get the following output (notice the
last line is there).

Trying ###.###.###.# ...
Connected to xxxx.xxxx.xxxx.
Escape character is '^]'.
Unauthorized Use Is Prohibited. TELNET denied!

Why is it dropping the last line?

The CNA Corporation ___ ____ ____ ___ _____ ____ _ _
------------------- / __)( _ \( ___)/ __)( _ )( _ \( \/ )
http://www.conference.cna.org ( (_-. ) / )__)( (_-. )(_)( ) / \ /
Phone: (703) 824 - 2149 \___/(_)\_)(____)\___/(_____)(_)\_) (__)
E-Mail: ggg@cna.org ___ _____ __ ____ ___ ____ ____ ____ _ _
  o \ o / / __)( _ )( ) ( _ \ / __)(_ _)( ___)(_ _)( \( )
 /|\ | __\o ( (_-. )(_)( )(__ )(_) )\__ \ )( )__) _)(_ ) (
 / \ / \ /) / \___/(_____)(____)(____/ (___/ (__) (____)(____)(_)\_)



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:10:55 CDT