I have a couple of apps (literally a couple - they are coupled!) to backup the SQL database on the server and restore it on the other server. To move the .bak file across the wire, I zip it using the good old pkzip25. Now since this pair of apps runs unattended, I need extensive logging and error checking - which works for most of the stuff, except that I can't catch any errors while zipping or unzipping.
I'm generating a batch file, with all the proper long filenames, and running it vie Ed Rauh's Api_AppRun class. Now the classic way to capture output from a DOS-style command is to add " >some.log" at its end. So far so good - it does capture the stdout output. But errors go to stderr, and that is not captured at all.
So far my only way is to issue
pkzip25 -test the.zip >the.log
and check if there's an "OK" at the end of the last line of the.log. The text
PKZIP: (W4) Warning! file fails
PKZIP: (E9) No file(s) found
is lost to me.
Is there any way to redirect the stderr into a file as well?