[<<]Message[>>]    [<<]Author[>>]    [<<]Subject        [<<]Thread    

Number : 3358 Date : 2002-12-20 Author : Garry Deane Subject : Re: how to trap success? Size(KB) : 1
In addition to creating a log file as Arian has suggested, you can test the exit code with an IF ERRORLEVEL test and take appropriate action to notify the user depending on the error. Xxcopy returns exit codes as follows: 0 - No error 1-99 - OS, syntax, etc error 100 - Nothing found matching copy criteria 101-> Failed to copy (errorno-100) files. See xxcopy /helpe for more detail. Bearing in mind that an IF ERRORLEVEL nn test is true if the error code is equal to or GREATER than nn, you can do something like the following: XXCOPY source target /oAxxcopy.log if errorlevel 101 goto :copyerror if errorlevel 100 goto :nocopy if errorlevel 1 goto :fatalerror :: All went well, no errors echo Xxcopy completed successfully goto :eof :copyerror [errorlevel 101 or higher] :: Some files not copied, might be a problem echo Xxcopy completed successfully but failed to copy some files :: Other commands like Blat to notify of partial error goto :eof :nocopy [errorlevel 100] :: Success unless there will always be files to copy echo Xxcopy could not find any files to copy goto :eof :fatalerror [errorlevel 1-99] :: Serious error encountered echo Xxcopy encountered a fatal error :: Other commands like Blat to notify of fatal error goto :eof Garry --- In xxcopy@yahoogroups.com, "Brad Kingsley" wrote: > I'd like a tool - like XXCOPY - to mirror content on some > servers. I was thinking that I'd set it up in a batch file > and call it that way. What are others doing to trap success > or error messages? The thing that makes me nervous about > this (or Robocopy) is that I don't have a good way to tell > if it worked or if it had errors. For example, it could be > scheduled to run at midnight every day, and perhaps one night > it got an error 3/4 of the way through the mirror -- how > would I know?
This message if part of XXCOPY's message Archive. The archive contains all the messages posted at Yahoo!Groups: XXCOPY.