| 1. |
Solve : Batch copy across network with failure log? |
|
Answer» I'll just post this while I try to find the answer in the past POSTS... Is there a way to log XCopy's failures and which file it failed on? Output usually consists of two output streams (1-STDOUT and 2-STDERR) which can be redirected together or separately. The default is the console. xcopy parms >good.log 2>bad.log each stream goes to separate files OR xcopy parms 2>bad.log one stream to console; errors to file OR xcopy parms 2> both.log 1>&2 both streams to same output file Quote Is there a way to emulate a keypress so I can get past XXCopy's complaints and still keep it logged properly so I can ensure the integrity of my backup? You might be able to pipe the enter key into xxcopy: ECHO. | xxcopy parms Not all programs can accept input from the pipe, but hey, you never know. Good luck. I think I have a similar request to the lines of this. I want to output the copied files to a file, I can do that by typing >>%log% at the end of the command, but if there is a user prompt .... Does \\Server\directory\Forms specify a file name or directory name on the target (F = file, D = directory)? Is there a way to keep everything in the log and directory it to the console so the user can enter D for directory, or better yet of course have it automate. Dos is pretty much my only option at this time. If too off topic I will open a new topic. Thanks for your help. Now that I'm thinking about this a little more I think I figured it out. I can push everything to the log, then before the coping of the directory just make the directory first assuming I know its name which in this case I do. Now for future reference if I didn't how could I handle this? While the literal from a prompt may end up in the log, there is still an interrupt pending on the console. PROVIDED you know the actual prompt, you can pump in the response: echo D | xcopy source target >> log.txt OR echo F | xcopy source target >> log.txt For programs that require multiple responses you can create a sequential response file and redirect the STDIN data stream: xcopy source target 1>log.txt 0<resp.txt The resp.txt file might contain: D Y which will cover the situation when XCOPY first asks about files/directories and then requests your permission for overwrites. Good luck. Thank you for that, It worked. You can also try Syncback. I use it on my servers to backup files across machines. http://www.2brightsparks.com/syncback/sbse-features.html it works great and even creates a HTML log. |
|