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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect standard output to file in CRON

Status
Not open for further replies.

JonathanHolliday

Technical User
Aug 20, 2003
9
GB
I have a script that runs a program with an interactive user parameters screen.

In order to run this as a CRON job 'we' have created a script that passes the key depressions to the job.

The trouble is the CRON job is "blind" so any on-screen messages that may have occured during an interactive run are not seen.

Is there a script statement to redirect output to a log file instead of the default of screen?

Script example:

$TRADERDIR/bin/jvint -k6 > /dev/null << INPUT
^?


B001
B001
$FROMDAY
$TODAY
S
U
N
pospost
^[[H^?^[[F

INPUT

(jvint6 -k6 is the program to run & INPUT is the parameters to enter, including control characters).

Thanks,

Jonathan
 
I wonder whether running strings on the log file afterwards will make the output any easier to decipher:

strings your.log > your_new.log

might do it.
 
this sounds like a job for expect, as far as sending input to the cron job. Try the tee program for sending all output to a file, either that or possibly run it with nohup, as that sends STDOUT to a logfile by default

Click below for S8700 Media Server information
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top