Saturday, May 23, 2015

windows - How do I hide "Extra File" and "100%" lines from robocopy output?


I have a robocopy script to back up our Kiln repositories that runs nightly, which looks something like this:


robocopy "$liveRepoLocation" "$cloneRepoLocation" /MIR /MT /W:3 /R:100 /LOG:"$backupLogLocation\BackupKiln.txt" /NFL /NDL /NP

In the output, there are a ton of lines that contain "Extra file"s, like this:


*EXTRA File              153    E:\Kiln Backup\elasticsearch\data\elasticsearch-kiln\nodes\0\indices\kiln-2\0\index\_yxe.fdt
*EXTRA File 12 E:\Kiln Backup\elasticsearch\data\elasticsearch-kiln\nodes\0\indices\kiln-2\0\index\_yxe.fdx
*EXTRA File 128 E:\Kiln Backup\elasticsearch\data\elasticsearch-kiln\nodes\0\indices\kiln-2\0\index\_yxe.fnm
*EXTRA File 363 E:\Kiln Backup\elasticsearch\data\elasticsearch-kiln\nodes\0\indices\kiln-2\0\index\_yxe.frq
*EXTRA File 13 E:\Kiln Backup\elasticsearch\data\elasticsearch-kiln\nodes\0\indices\kiln-2\0\index\_yxe.nrm

Additionally, there are then hundreds of lines at the bottom that contain nothing but "100%"s, like this:


100%
100%
100%
100%
100%
100%
100%

In addition to making the log files enormous (there are a lot of folders/files in Kiln repos), it makes it annoying to scan through the logs now and then to see if everything was working ok.



  1. How do I stop "Extra Files" appearing in the log? (edit: the whole rows, not just the text as /NC will stop)

  2. How do I stop these silly "100%" lines appearing in the log?


I've tried every combination of switch I can think of (the current switches are listed above in the command), but neither seem to hide these!


Answer



Just noticed you are missing a /NC there.


/NC: No Class - don’t log file classes.


Class files are... What does robocopy mean by tweaked, lonely and extra?


So I'd try:
robocopy "$liveRepoLocation" "$cloneRepoLocation" /MIR /MT /W:3 /R:100 /NP /LOG:"$backupLogLocation\BackupKiln.txt" /NC


Edit 1


My bad. Didn't see you had already mentioned trying /NC


I've tested here. It seems that the /MIR option ignores the logging options. Also /MT messes it up, adding the 100%.


The only way I got working was



D:\robocopy>robocopy source destination /MIR /W:3 /R:100 /NS /NC /NFL /NDL /NP /LOG:log.txt".



*It actually works with /MIR. But you have to specify /NFL and /NDL.* Don't know if that's acceptable for you.


If you try /MT, it will still show the silly 100%


Edit 2


I know the question was about Robocopy but I think you should give RichCopy a try
http://technet.microsoft.com/en-us/magazine/2009.04.utilityspotlight.aspx


Here's the command line:



richcopy "D:\robocopy\source" "D:\robocopy\destination" /P /QO /QP "D:\robocopy\report.log" /UE /US /UD /UPC /UFC /USC /UPR /UET



It starts RichCopy's GUI and closes when done.


And here's the log



28/11/2012 11:35:19,0,Copy start,


28/11/2012 11:35:20,0,Source path : D:\robocopy\source,


28/11/2012 11:35:20,0,Destination path : d:\robocopy\destination,


28/11/2012 11:35:20,0,Source file count : 12 files,


28/11/2012 11:35:20,0,Copied file count : 13 files,


28/11/2012 11:35:20,0,Purged file count : 1,224 files,


28/11/2012 11:35:20,0,Elapsed time : 00:00:01,


28/11/2012 11:35:20,0,Average performance : 1,641,528 bytes / sec,


28/11/2012 11:35:20,0,Average performance : 13 files / sec,


28/11/2012 11:35:20,0,Copy complete,D:\robocopy\source



No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...