|
| |||||||||
| Tags: destination, output, providing, robocopy |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Robocopy - not providing destination in log output
I am working with Robocopy to copy and move multiple files to multiple directories. All is working well except for the logging. I am able to get the log to output the source info but cannot get it to output the destination directory without adding the job summary. I do not want to include the job summary as this provides to much information for my logging requirements. I don't want to move away from Robocopy just because of this one missing piece but simpler apps like XCopy have this ability. I have tried the /fp switch but this still does not list the destination directory. |
|
#2
| |||
| |||
| Re: Robocopy - not providing destination in log output "JMic" <JMic@discussions.microsoft.com> wrote in message news:E49B0812-0324-44D9-B761-F47A2359D904@microsoft.com... >I am working with Robocopy to copy and move multiple files to multiple > directories. All is working well except for the logging. I am able to get > the > log to output the source info but cannot get it to output the destination > directory without adding the job summary. I do not want to include the job > summary as this provides to much information for my logging requirements. > I > don't want to move away from Robocopy just because of this one missing > piece > but simpler apps like XCopy have this ability. I have tried the /fp switch > but this still does not list the destination directory. The destination directory is shown right up the top. It is the same for each and every file: Source : h:\ Dest : d:\HulDisk\ If you want to show it for every copied file then you could write a simple little script that changes this log file line: New Dir 8 h:\WINDOWS\system32\oobe\regerror\ into this one: New Dir 8 h:\WINDOWS\system32\oobe\regerror\ d:\HulDisk\WINDOWS\system32\oobe\regerror\ |
|
#3
| |||
| |||
| Re: Robocopy - not providing destination in log output
I am sorry but I am not understanding what you are referring to when you say "The destination directory is shown right up the top". Are you referring to what is reported in the job summary or the job header? I have seen this in the job summary but do not want all of the other information that comes with adding this. Clearly the information is available through Robocopy but how do I extract/parse this information into a simple log file? Here is a copy of the syntax I am using currently: echo %time%___%yr%_%mth%_%day% >>TodaysPages.log C:\Utilities\robocopy C:\TEMP C:\TEMP\PrintSites na*.pdf /NP /R:3 /W:3 /IS /IT /NP /NC /NS >>TodaysPages.log /NDL /NJH /NJS /R:3 /W:3 The log file results of this are: 16:12:59.39___2009_06_18 C:\TEMP\NATest1.pdf C:\TEMP\NATest2.pdf C:\TEMP\NATest3.pdf "Pegasus [MVP]" wrote: > > "JMic" <JMic@discussions.microsoft.com> wrote in message > news:E49B0812-0324-44D9-B761-F47A2359D904@microsoft.com... > >I am working with Robocopy to copy and move multiple files to multiple > > directories. All is working well except for the logging. I am able to get > > the > > log to output the source info but cannot get it to output the destination > > directory without adding the job summary. I do not want to include the job > > summary as this provides to much information for my logging requirements. > > I > > don't want to move away from Robocopy just because of this one missing > > piece > > but simpler apps like XCopy have this ability. I have tried the /fp switch > > but this still does not list the destination directory. > > The destination directory is shown right up the top. It is the same for each > and every file: > Source : h:\ > Dest : d:\HulDisk\ > > If you want to show it for every copied file then you could write a simple > little script that changes this log file line: > New Dir 8 h:\WINDOWS\system32\oobe\regerror\ > into this one: > New Dir 8 h:\WINDOWS\system32\oobe\regerror\ > d:\HulDisk\WINDOWS\system32\oobe\regerror\ > > > |
|
#4
| |||
| |||
| Re: Robocopy - not providing destination in log output
I recommend you modify your command by ommitting the following switches: - The second /np (it's duplicated) - The second /r:3 (it's duplicated) - The second /w:3 (it's duplicated) - /njh (so that you can see the header). You will then see the following report: ------------------------------------------------------------------------------- ROBOCOPY :: Robust File Copy for Windows :: Version XP010 ------------------------------------------------------------------------------- Started : Fri Jun 19 13:00:37 2009 Source : C:\MYOB105\ Dest = d:\Fri\ *** This is the target folder *** Files : *.exe Options : /NS /NC /NDL /NJS /COPY:DAT /NP /IS /IT /R:3 /W:3 ------------------------------------------------------------------------------ C:\MYOB105\drvwd32.exe C:\MYOB105\drvxl32.exe C:\MYOB105\DZPROG32.exe C:\MYOB105\Myob.exe C:\MYOB105\Myobopt.exe C:\MYOB105\Myobupg.exe If you don't want the header in your log file then you can write a simple script that does the following: - It reads the header - It notes the target folder - It writes the names of all copied files to a second log file, complete with the target folder name on each line. "JMic" <JMic@discussions.microsoft.com> wrote in message news:F174AA43-A64B-4CDA-B0C8-DC4728039C76@microsoft.com... >I am sorry but I am not understanding what you are referring to when you >say > "The destination directory is shown right up the top". Are you referring > to > what is reported in the job summary or the job header? I have seen this in > the job summary but do not want all of the other information that comes > with > adding this. Clearly the information is available through Robocopy but how > do > I extract/parse this information into a simple log file? Here is a copy of > the syntax I am using currently: > echo %time%___%yr%_%mth%_%day% >>TodaysPages.log > C:\Utilities\robocopy C:\TEMP C:\TEMP\PrintSites na*.pdf /NP /R:3 /W:3 /IS > /IT /NP /NC /NS >>TodaysPages.log /NDL /NJH /NJS /R:3 /W:3 > > The log file results of this are: > > 16:12:59.39___2009_06_18 > > C:\TEMP\NATest1.pdf > C:\TEMP\NATest2.pdf > C:\TEMP\NATest3.pdf > > "Pegasus [MVP]" wrote: > >> >> "JMic" <JMic@discussions.microsoft.com> wrote in message >> news:E49B0812-0324-44D9-B761-F47A2359D904@microsoft.com... >> >I am working with Robocopy to copy and move multiple files to multiple >> > directories. All is working well except for the logging. I am able to >> > get >> > the >> > log to output the source info but cannot get it to output the >> > destination >> > directory without adding the job summary. I do not want to include the >> > job >> > summary as this provides to much information for my logging >> > requirements. >> > I >> > don't want to move away from Robocopy just because of this one missing >> > piece >> > but simpler apps like XCopy have this ability. I have tried the /fp >> > switch >> > but this still does not list the destination directory. >> >> The destination directory is shown right up the top. It is the same for >> each >> and every file: >> Source : h:\ >> Dest : d:\HulDisk\ >> >> If you want to show it for every copied file then you could write a >> simple >> little script that changes this log file line: >> New Dir 8 h:\WINDOWS\system32\oobe\regerror\ >> into this one: >> New Dir 8 h:\WINDOWS\system32\oobe\regerror\ >> d:\HulDisk\WINDOWS\system32\oobe\regerror\ >> >> >> |
|
#5
| |||
| |||
| Re: Robocopy - not providing destination in log output
I was affraid of this being the only option. Yes, what you suggest is possible but only with additional coding and massaging of the original log file output. I was hoping there would be something much simpler, like the switch in XCopy that turns on the full file path showing both source and destination without any additional coding/data massaging. Thanks for the cleanup tips. I will implement these immediatly. If you or others have any other suggestions as to how to proceed - please no VBS or Perl suggestions as I am not well versed in either to make the switch, I would be gratefull. Cheers Jmic "Pegasus [MVP]" wrote: > I recommend you modify your command by ommitting the following switches: > - The second /np (it's duplicated) > - The second /r:3 (it's duplicated) > - The second /w:3 (it's duplicated) > - /njh (so that you can see the header). > You will then see the following report: > ------------------------------------------------------------------------------- > ROBOCOPY :: Robust File Copy for Windows :: Version XP010 > ------------------------------------------------------------------------------- > Started : Fri Jun 19 13:00:37 2009 > Source : C:\MYOB105\ > Dest = d:\Fri\ *** This is the target folder *** > Files : *.exe > Options : /NS /NC /NDL /NJS /COPY:DAT /NP /IS /IT /R:3 /W:3 > ------------------------------------------------------------------------------ > C:\MYOB105\drvwd32.exe > C:\MYOB105\drvxl32.exe > C:\MYOB105\DZPROG32.exe > C:\MYOB105\Myob.exe > C:\MYOB105\Myobopt.exe > C:\MYOB105\Myobupg.exe > > If you don't want the header in your log file then you can write a simple > script that does the following: > - It reads the header > - It notes the target folder > - It writes the names of all copied files to a second log file, complete > with the target folder name on each line. > > > "JMic" <JMic@discussions.microsoft.com> wrote in message > news:F174AA43-A64B-4CDA-B0C8-DC4728039C76@microsoft.com... > >I am sorry but I am not understanding what you are referring to when you > >say > > "The destination directory is shown right up the top". Are you referring > > to > > what is reported in the job summary or the job header? I have seen this in > > the job summary but do not want all of the other information that comes > > with > > adding this. Clearly the information is available through Robocopy but how > > do > > I extract/parse this information into a simple log file? Here is a copy of > > the syntax I am using currently: > > echo %time%___%yr%_%mth%_%day% >>TodaysPages.log > > C:\Utilities\robocopy C:\TEMP C:\TEMP\PrintSites na*.pdf /NP /R:3 /W:3 /IS > > /IT /NP /NC /NS >>TodaysPages.log /NDL /NJH /NJS /R:3 /W:3 > > > > The log file results of this are: > > > > 16:12:59.39___2009_06_18 > > > > C:\TEMP\NATest1.pdf > > C:\TEMP\NATest2.pdf > > C:\TEMP\NATest3.pdf > > > > "Pegasus [MVP]" wrote: > > > >> > >> "JMic" <JMic@discussions.microsoft.com> wrote in message > >> news:E49B0812-0324-44D9-B761-F47A2359D904@microsoft.com... > >> >I am working with Robocopy to copy and move multiple files to multiple > >> > directories. All is working well except for the logging. I am able to > >> > get > >> > the > >> > log to output the source info but cannot get it to output the > >> > destination > >> > directory without adding the job summary. I do not want to include the > >> > job > >> > summary as this provides to much information for my logging > >> > requirements. > >> > I > >> > don't want to move away from Robocopy just because of this one missing > >> > piece > >> > but simpler apps like XCopy have this ability. I have tried the /fp > >> > switch > >> > but this still does not list the destination directory. > >> > >> The destination directory is shown right up the top. It is the same for > >> each > >> and every file: > >> Source : h:\ > >> Dest : d:\HulDisk\ > >> > >> If you want to show it for every copied file then you could write a > >> simple > >> little script that changes this log file line: > >> New Dir 8 h:\WINDOWS\system32\oobe\regerror\ > >> into this one: > >> New Dir 8 h:\WINDOWS\system32\oobe\regerror\ > >> d:\HulDisk\WINDOWS\system32\oobe\regerror\ > >> > >> > >> > > > |
|
#6
| |||
| |||
| Re: Robocopy - not providing destination in log output "JMic" <JMic@discussions.microsoft.com> wrote in message news:622132DD-FC7D-470D-811F-A392029822F3@microsoft.com... >I was affraid of this being the only option. Yes, what you suggest is > possible but only with additional coding and massaging of the original log > file output. I was hoping there would be something much simpler, like the > switch in XCopy that turns on the full file path showing both source and > destination without any additional coding/data massaging. > > Thanks for the cleanup tips. I will implement these immediatly. If you or > others have any other suggestions as to how to proceed - please no VBS or > Perl suggestions as I am not well versed in either to make the switch, I > would be gratefull. > > Cheers > Jmic I'm somewhat baffled. People who post questions in a *scripting* newsgroup are usually after some scripting solution, yet you specifically do not want such a solution. In this case it might be better for you to repost your question in a general type newsgroup (e.g. windowsxp.general) because you're after a command that will combine the robustness of robocopy with the output format of xcopy. Perhaps xxcopy.exe? Anyway, I recommend you have a closer look at VB Scripts. They are a very powerful solution for a great many problems. In your case a handful of lines would do pretty much what you need when invoked like this: cscript //nologo c:\Jmic.vbs < c:\robocopy.log > c:\robocopy.txt [01] Set oInput = WScript.StdIn [02] sDest = "" [03] While Not oInput.AtEndOfStream [04] sLine = oInput.ReadLine [05] If sDest = "" Then [06] p = InStr(1, sLine, "Dest = ", 1) [07] If p > 0 Then [08] sSource = Mid(sPrev, InStr(sPrev, ":") + 2) [09] sDest = Mid(sLine, InStr(sLine, "=") + 2) [10] End If [11] sPrev = sLine [12] Else [13] If InStr(sLine, "\") > 0 Then WScript.Echo pad(sLine, sSource, sDest) [14] End If [15] Wend [16] oInput.Close [17] [18] Function pad (sString, sFrom, sTo) [19] sString = LTrim(Replace(sString, vbTab, "")) [20] If Len(sString) < 38 _ [21] Then sSpacer = Space(38 - Len(sString)) Else sSpacer = " " [22] pad = sString & sSpacer & sTo & Mid(sString, Len(sSource)+1) [23] End Function |
|
#7
| |||
| |||
| Re: Robocopy - not providing destination in log output
I must respectfully disagree with you on this last comment. I consider a batch file to be a form of scripting and invoking a Microsoft supplied command line tool to be a part of that. My main concern was having to either move away from an existing, working script (Batch file) servicing a large production need for only logging reasons or find that I have missed something with the current script/command line tools. I am not sure if this would be considered ignorance or bad etiquette on my part though. :) I am working on but have not graduated to using VB Scripts. When I get to the same comfort level as I am with batch files, I will no doubt be converting many of my current batch files to VB. Thanks for the sample script. I will take this into the migration from batch files to VBS shortly. Cheers JMic "Pegasus [MVP]" wrote: > > "JMic" <JMic@discussions.microsoft.com> wrote in message > news:622132DD-FC7D-470D-811F-A392029822F3@microsoft.com... > >I was affraid of this being the only option. Yes, what you suggest is > > possible but only with additional coding and massaging of the original log > > file output. I was hoping there would be something much simpler, like the > > switch in XCopy that turns on the full file path showing both source and > > destination without any additional coding/data massaging. > > > > Thanks for the cleanup tips. I will implement these immediatly. If you or > > others have any other suggestions as to how to proceed - please no VBS or > > Perl suggestions as I am not well versed in either to make the switch, I > > would be gratefull. > > > > Cheers > > Jmic > > I'm somewhat baffled. People who post questions in a *scripting* newsgroup > are usually after some scripting solution, yet you specifically do not want > such a solution. In this case it might be better for you to repost your > question in a general type newsgroup (e.g. windowsxp.general) because you're > after a command that will combine the robustness of robocopy with the output > format of xcopy. Perhaps xxcopy.exe? > > Anyway, I recommend you have a closer look at VB Scripts. They are a very > powerful solution for a great many problems. In your case a handful of lines > would do pretty much what you need when invoked like this: > cscript //nologo c:\Jmic.vbs < c:\robocopy.log > c:\robocopy.txt > > [01] Set oInput = WScript.StdIn > [02] sDest = "" > [03] While Not oInput.AtEndOfStream > [04] sLine = oInput.ReadLine > [05] If sDest = "" Then > [06] p = InStr(1, sLine, "Dest = ", 1) > [07] If p > 0 Then > [08] sSource = Mid(sPrev, InStr(sPrev, ":") + 2) > [09] sDest = Mid(sLine, InStr(sLine, "=") + 2) > [10] End If > [11] sPrev = sLine > [12] Else > [13] If InStr(sLine, "\") > 0 Then WScript.Echo pad(sLine, sSource, > sDest) > [14] End If > [15] Wend > [16] oInput.Close > [17] > [18] Function pad (sString, sFrom, sTo) > [19] sString = LTrim(Replace(sString, vbTab, "")) > [20] If Len(sString) < 38 _ > [21] Then sSpacer = Space(38 - Len(sString)) Else sSpacer = " " > [22] pad = sString & sSpacer & sTo & Mid(sString, Len(sSource)+1) > [23] End Function > > > > |
|
#8
| |||
| |||
| Re: Robocopy - not providing destination in log output "JMic" <JMic@discussions.microsoft.com> wrote in message news:4E4C689B-FE7C-47E0-BBED-9E527AEB8A19@microsoft.com... >I must respectfully disagree with you on this last comment. I consider a > batch file to be a form of scripting and invoking a Microsoft supplied > command line tool to be a part of that. My main concern was having to > either > move away from an existing, working script (Batch file) servicing a large > production need for only logging reasons or find that I have missed > something > with the current script/command line tools. I am not sure if this would be > considered ignorance or bad etiquette on my part though. :) > > I am working on but have not graduated to using VB Scripts. When I get to > the same comfort level as I am with batch files, I will no doubt be > converting many of my current batch files to VB. > > Thanks for the sample script. I will take this into the migration from > batch > files to VBS shortly. > > Cheers > JMic I don't believe in converting batch files to VB Script files. Batch files tend to be good at some things and lousy at others, and vice versa. String manipulation is far more powerful and robust in VB Scripts than in batch files. Performing everyday admin tasks such as copying/backing up files takes far less effort in batch files than in VB Script files. You could massage your robocopy log file with a batch file but it would be painful, fragile and probably quite slow. With VB Scripts its easy - just an exercise in basic string manipulation. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Robocopy - not providing destination in log output" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Saving New Destination On Nuron Ovi Map 3.03 | avesh | Portable Devices | 4 | 07-02-2011 11:52 PM |
| Which telecoms will be providing 3G services. | kristtoper | India BroadBand | 4 | 12-11-2010 11:36 AM |
| Destination Host Unreachable | mikeyuf@gmail.com | Windows XP Support | 2 | 23-09-2009 09:37 AM |
| Reliance not providing GPRS | roshanK | India BroadBand | 3 | 30-01-2009 02:22 PM |
| Do not create destination folder using ROBOCOPY | sarat123 | Windows Server Help | 9 | 22-01-2009 04:03 AM |