Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Batch File: Robocopy

Posted on 2010-08-27
7
Medium Priority
?
827 Views
Last Modified: 2012-05-10
Hi there,

I have this Robocopy command line that needs to be "fixed".

Robocopy "!BasePath_Source!" "!BasePath_Dest!" * /TEE /ETA /E /COPYALL /MIR /NP /ZB /LOG+:"%File_LOG_Mirror%_temp.TXT" /XF Thumbs.db ~*.* *.swp *.dmp *.tmp pagefile.sys hiberfil.sys /XD MCAF*.TMP "$VAULT$.AVG" "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information" "Virtual Machines *" "temp" ISO

PROBLEM:
-------------------------------------------------------------
The LOG file stores all the files = NO GOOD

I need that the LOG file only logs the new, or changed files = GOOD

Thanks for your help,
Rene


0
Comment
Question by:ReneGe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 57

Expert Comment

by:Bill Prew
ID: 33546874
Do you mean you want the copy itself to only copy the new or changed files, or that you still want it to copy all files, but only log the new and changed files?

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33546914
Hey bp!

The mirror part does it good.

My focus here is the log file.

I only want to log the copied or changed files.

Thanks,
Rene
0
 
LVL 57

Assisted Solution

by:Bill Prew
Bill Prew earned 1000 total points
ID: 33546973
Hmm, a little confused.  When I ran a test with the /MIR option, it only listed the file names of the files it copied, see attached.  What am I missing?

~bp
[c:\temp]robocopy c:\temp\xxcopy c:\temp2\xxcopy /mir
 
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------
 
  Started : Fri Aug 27 18:14:23 2010
 
   Source : c:\temp\xxcopy\
     Dest : c:\temp2\xxcopy\
 
    Files : *.*
 
  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30
 
------------------------------------------------------------------------------
 
          New Dir          6    c:\temp\xxcopy\
100%        New File                2026        UIXXCOPY.BAT
100%        New File              146936        XXCONSOLE.EXE
100%        New File              911751        XXCOPY.CHM
100%        New File              499248        XXCOPY.EXE
100%        New File              499248        XXCOPYSU.EXE
100%        New File               69632        XXPBAR.EXE
 
------------------------------------------------------------------------------
 
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         1         0         0         0         0
   Files :         6         6         0         0         0         0
   Bytes :    2.03 m    2.03 m         0         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
 
 
   Speed :             3235320 Bytes/sec.
   Speed :             185.126 MegaBytes/min.
 
   Ended : Fri Aug 27 18:14:24 2010
 
[c:\temp]robocopy c:\temp\xxcopy c:\temp2\xxcopy /mir
 
-------------------------------------------------------------------------------
   ROBOCOPY     ::     Robust File Copy for Windows
-------------------------------------------------------------------------------
 
  Started : Fri Aug 27 18:14:33 2010
 
   Source : c:\temp\xxcopy\
     Dest : c:\temp2\xxcopy\
 
    Files : *.*
 
  Options : *.* /S /E /COPY:DAT /PURGE /MIR /R:1000000 /W:30
 
------------------------------------------------------------------------------
 
                           6    c:\temp\xxcopy\
 
------------------------------------------------------------------------------
 
               Total    Copied   Skipped  Mismatch    FAILED    Extras
    Dirs :         1         0         1         0         0         0
   Files :         6         0         6         0         0         0
   Bytes :    2.03 m         0    2.03 m         0         0         0
   Times :   0:00:00   0:00:00                       0:00:00   0:00:00
 
   Ended : Fri Aug 27 18:14:33 2010

Open in new window

0
The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

 
LVL 10

Author Comment

by:ReneGe
ID: 33547054
Me, it also lists all bunch of non changed folders.
0
 
LVL 2

Accepted Solution

by:
plymelk earned 1000 total points
ID: 33547120
Add the following options to your command.
     /NDL    Exclude directory names (listing)
     /XO     Exclude Old files
     /XX      Exclude Extra files (files in the destination, but not in the original source)
You may want to use this option, but most likely not.
     /XL     Exclude Lonely (Unique files are not copied)
New command:
Robocopy "!BasePath_Source!" "!BasePath_Dest!" * /NDL /XX /XO /TEE /ETA /E /COPYALL /MIR /NP /ZB /LOG+:"%File_LOG_Mirror%_temp.TXT" /XF Thumbs.db ~*.* *.swp *.dmp *.tmp pagefile.sys hiberfil.sys /XD MCAF*.TMP "$VAULT$.AVG" "_RESTORE" "MSOCache" "Recycled" "RECYCLER" "Temporary Internet Files" "System Volume Information" "Virtual Machines *" "temp" ISO
0
 
LVL 57

Expert Comment

by:Bill Prew
ID: 33547145
Yes, I think /NDL is what you are after.

~bp
0
 
LVL 10

Author Comment

by:ReneGe
ID: 33547184
/NDL was indeed the solution.

Thanks guys!!!

Cheers,
Rene
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Introduction to Processes

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question