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

VLDB Utilities script problem 2

Status
Not open for further replies.

bizzyb

Technical User
Jan 13, 2003
30
0
0
US
Am trying to automate the task of running the dbcheck utility on my servers over the weekend, and saving the output to a text file. I am using the sample script (doc#18200) from the arcserve web site as a guide.
Although the commands work fine, only part of the output goes to the text file. The final line of the output that says whether there were errors or not, prints to the screen and not to the text file.
Here is the batch file:

echo off

REM This will check all of the databases for errors
dbcheck -a -L arcserve;admin;secret asjob >> ARCdblog.txt
dbcheck -a -L arcserve;admin;secret asmedia >> ARCdblog.txt


Any suggestions on how to get the complete output to the text file instead of the screen?
 
I neglected to say in the post, that we are running Win2000, with ARCserve 2000, and am running the script from the windows task scheduler.
Any help would be appreciated.
Thanks, Foland
 
You are only redirecting stdout with >>. The last line is most likely written to stderr. Try this instead:

dbcheck -a -L arcserve;admin;secret asjob 1> ARCdblog.txt 2>&1

dbcheck -a -L arcserve;admin;secret asmedia 1> ARCdblog.txt 2>&1

Now stdout (1) and stderr (2) will both be piped to the txt file.
 
ACiDelic - Thanks for the info. Redirecting the stderr did the trick. Now I can make the batch file work the way I need it too.
Appreciate your help!
Foland
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top