• 0

Simple Windows robocopy batch. Need help.


Question

I've made a simple robocopy script, but it's not doing what I want. To keep it simple for now, I have only one job, and I am running it as a dry run.

set robocopy="C:\Windows\System32\robocopy.exe"
Set LogFile="D:\backup to downstairs.txt"
set options=/L /mir /dcopy:T /copy:DAT /xa:h /LOG+:%LogFile%
set exclude=D:\Programs\uTorrent "D:\unknownsoldierx\Audio Books" D:\unknownsoldierx\Desktop D:\unknownsoldierx\Favorites D:\unknownsoldierx\Links

%robocopy% D:\Android \\DOWNSTAIRS\Android %options% /XD %exclude%
[/CODE]

Here is the result. Why does it include switches I haven't specified, especially the /purge switch, which I definitely do not want?

Also, how can I perform /LOG and /v at the same time? I'd like to specify the file name for the log, but I also want verbose output so I can see which files were skipped.

[CODE]
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------

Started : Mon Aug 13 10:41:50 2012

Source : D:\Android\
Dest : \\DOWNSTAIRS\Android\

Files : *.*

Exc Dirs : D:\Programs\uTorrent
D:\unknownsoldierx\Audio Books
D:\unknownsoldierx\Desktop
D:\unknownsoldierx\Favorites
D:\unknownsoldierx\Links

Options : *.* /L /S /E /COPY:DAT /DCOPY:T /PURGE /MIR /XA:H /R:1000000 /W:30

------------------------------------------------------------------------------

I've ommited the file list

------------------------------------------------------------------------------

Total Copied Skipped Mismatch FAILED Extras
Dirs : 19 18 1 0 0 0
Files : 62 62 0 0 0 0
Bytes : 881.92 m 881.92 m 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00

Ended : Mon Aug 13 10:41:50 2012
[/CODE]

4 answers to this question

Recommended Posts

  • 0

Take a look at this site, it explains what each switch does, it should help identify what is adding the additional switches. I can't see why you can't add /v as well as /Log...

/MIR : MIRror a directory tree - equivalent to /PURGE plus all subfolders (/E)

That's why it's adding the /PURGE

  • 0

That's what I get for doing this before my morning coffee. I copied this from another backup script I had. I actually do want /purge, not /mir. So that issue is solved

Also, forgot to mention that I've tried adding the /v switch, but it doesn't show in the log what dir/files were skipped.


set options=/L /s /e /purge /dcopy:T /copy:DAT /xa:h /LOG+:%LogFile% /v
[/CODE]

  • 0

Looking at RIchCopy now. I don't see how to get a command line string from it.

Edit: Nevermind, it's on the Others tab. It's confusing. There's arguments that aren't listed in the Robocopy help.

/QA and /QP

And besides the source and destination, it wants to do something with "C:\Users\unknownsoldierx\AppData\Local\Temp\clEE55.tmp".

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.