Question

There is the following line command:

statdump -zdl %db% > "%ckpdb_dir%"\statdump_%db%.log

the result of the Statdump is sent to the log file, but I would like that if there is some error, for example that the statdump is being used already by another process, and then I get the message "The process cannot access the file because it is being used by anoter process on the screen, but I would like to capture these message in a file.

I tried with:

statdump -zdl %db% > "%ckpdb_dir%"\statdump_%db%.log > ckpdb.log

but is not the solution...

btw there is no error generated when happen this

Was it helpful?

Solution

Try this:

statdump -zdl %db% -o "%ckpdb_dir%\statdump_%db%.log" 2> error.log

OTHER TIPS

You want to redirect stderr somewhere else than stdout like this:

statdump -zdl %db% >"%ckpdb_dir%\statdump_%db%.log" 2>err.log

The last part redirects stderr to the file err.log.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top