Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"bad file unit number" error from shell script run under cron

Status
Not open for further replies.

Blizard

Technical User
Aug 2, 2002
14
US
I am getting an odd failure from a ksh script on a system that was just upgraded from AIX 5.2 to 5.3 ML3. The script runs fine from the command line, but from cron I get the following email:

Cron Environment:
SHELL =
PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java130/jre/bin:/usr/java130/bin
CRONDIR=/var/spool/cron/crontabs
ATDIR=/var/spool/cron/atjobs
LOGNAME=root
HOME=/

Your "cron" job executed on nsyrp64a on Fri Feb 3 09:03:00 EST 2006 /home/root/production/DR-info/SCRIPTS/do-build-dr-script.ksh >> /tmp/build.log 2>&1À


produced the following output:

sh: 1^€: bad file unit number

I can't figure out why I am getting this all of a sudden. The script builds vg, lv, and fs recreation command files for use in DR. It has a few functions defined within the scripts, and calls a couple of perl scripts, but all other work is done within the shell script.

Any suggestions on where to look?

Robert Blizard
National Grid USA Service Co.
An expert is a man who has made all the mistakes which can be made, in a narrow field.
Neils Bohr (1885-1962)
 
Found the problem! Somewhere in the upgrade process I guess, an invalid character got appended to the cron entry. The result was that the command was trying to redirect stderr to a bogus file, rather than the usual '1'.

Thanks to all and any who gave this attention.

Robert Blizard
National Grid USA Service Co.
An expert is a man who has made all the mistakes which can be made, in a narrow field.
Neils Bohr (1885-1962)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top