Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I want to run RoboCopy that will update the console with % progress but not clutter the log file with % progress.

The following RoboCopy command will perform the desired copy and append logging information the log file.

RoboCopy <source> <dest> /log+:<log file> /tee

The problem is the log file is cluttered with % progress updates. Therefore I need to changed the command to this:

RoboCopy <source> <dest> /log+:<log file> /tee /np

Now the problem is I don't getting any % progress updates on screen.

I've read http://technet.microsoft.com/en-us/library/cc733145%28WS.10%29.aspx a few times now and can't find a switch(es) I need. Am I missing something or is what I want to achieve not possible?

share|improve this question
    
Do you have to use only builtin tools? –  Hello71 May 21 '11 at 14:39

2 Answers 2

up vote 1 down vote accepted

As nobody has answered this for so long, I thought I'd suggest a couple of things.

If you are using batch scripts, it should not be too difficult to use sed to strip out the unwanted progress information from the log file. I'm not experienced enough with it to give you a solution using it without spending some time on it though.

There is a single .exe file version of sed in UnxUtils (with a slightly more up to date version in the update zip).

Another option would be to use XXCOPY instead of Robocopy. It has a truly ridiculous number of switches (over 230), which allows you to do whatever you want. You have to spend a whole evening choosing which ones you want to use. It also has a GUI progress dialogue box, if you would prefer to use that.

There is a free version for personal use, which cannot be used for automated scripting, as you need to interactively follow prompts, unlike the paid-for version.

XXCOPY

Another alternative is RichCopy, which has a GUI which would can use to choose your options. It can then give you the command-line of you operation for use in batch scripts.

RichCopy

share|improve this answer

Re: robocopy and logged progress 'noise'

Solution: use just /TEE and let it log the 'noise', otherwise you'll not see any progress. Then use sed, as first suggested to clean the logfile as follows:

sed -i.bak "s/\x0d.*\x0d.*$//" logfile.txt

remove the .bak if you don't want an unfixed backup. sed is available for windows here, and works fine, at least for single* line use.

http://gnuwin32.sourceforge.net/packages/sed.htm

*(sed commands in unix bash/cshell scripts are often spread over multiple lines, adding more flexibility and complexity.. i don't expect those type of sed commands to work with windows cmd scripts, but sed is still useful under windows).

share|improve this answer
    
+1 Isn't there a way to pipe stdout through sed directly? –  paradroid Sep 17 '11 at 10:47
    
of course you can pipe through sed, that would however remove the progress information from the console display as well as possibly the logfile... –  Mac Sep 17 '11 at 10:57
    
Of course, but I thought maybe the tee command could be used instead of Robocopy's /TEE switch, but I have just realised that it is part of TCC/LE and not a standard CMD command. It is available in PowerShell though. –  paradroid Sep 17 '11 at 11:07
    
actually.. it still writes the progress mess to the logfile! So is the exact opposite of what is wanted. I just tested with: robocopy . tst /log:n:\tst.log /tee | sed "s/\x0d.*\x0d.*$//" –  Mac Sep 17 '11 at 11:07
    
tee is also available from gnuwin32.. but would have the same problem ;) gnuwin32.sourceforge.net/packages/coreutils.htm –  Mac Sep 17 '11 at 11:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.