1

I've got a .bat file that I created, which uploads new files to my company's server.  It works great, but after it runs, I have no idea what files are new vs same.  When the batch file runs, I can see when it pops up as new and when it pops up as same, but I want to create a log file that shows what files are new, excluding the files that weren't uploaded.

Currently, this is my .bat file:

robocopy "C:\HUSAPOGDATA\Product_Library" "\\NOAMSNYW024.noam.heiway.net\NationalAccounts\Category Management\Space Planning Images\Product_Library" beer.mdb 

robocopy "C:\HUSAPOGDATA\Product_Library" "\\NOAMSNYW024.noam.heiway.net\NationalAccounts\Category Management\Space Planning Images\Product_Library" SMSB_Library.mdb 

robocopy "C:\Pog Images\Images\Beer" "\\NOAMSNYW024.noam.heiway.net\NationalAccounts\Category Management\Space Planning Images\Pog Images\Images\Beer" /E *.1 *.2 *.3 *.7 *.8 *.9 /MIR /S /V /NP /ZB

I use the below command to log the data,

fromlocal2network_productlibrary_new.bat > C:\Merch\log.txt

but I don't want all of the command output, since the file gets huge from thousands of files being uploaded.  Is there a way to separate out the new files from the old in the log file?

1

2 Answers 2

2

Example syntax to add: /LOG+:%Log%

Source (below): Robocopy /?

::
:: Logging Options :
::
                 /L :: List only - don't copy, timestamp or delete any files.
                 /X :: report all eXtra files, not just those selected.
                 /V :: produce Verbose output, showing skipped files.
                /TS :: include source file Time Stamps in the output.
                /FP :: include Full Pathname of files in the output.
             /BYTES :: Print sizes as bytes.

                /NS :: No Size - don't log file sizes.
                /NC :: No Class - don't log file classes.
               /NFL :: No File List - don't log file names.
               /NDL :: No Directory List - don't log directory names.

                /NP :: No Progress - don't display % copied.
               /ETA :: show Estimated Time of Arrival of copied files.

          /LOG:file :: output status to LOG file (overwrite existing log).
         /LOG+:file :: output status to LOG file (append to existing log).

       /UNILOG:file :: output status to LOG file as UNICODE (overwrite existing
log).
      /UNILOG+:file :: output status to LOG file as UNICODE (append to existing
log).

               /TEE :: output to console window, as well as the log file.

               /NJH :: No Job Header.
               /NJS :: No Job Summary.

           /UNICODE :: output status as UNICODE.
0

Add /XO flag first of all to take care of removing older files from output.

Then, In order to further minimize the output in the resulting RoboCopy log you can add the following flags: /NDL /NS /NC.

Note: Only use /NC after you have tested the command and and found that the class information i.e. old files has been removed from the output. Test with /L flag. This flag is used to do a 'what if' of your command; no files are actually moved.

Using these four flags in addition to what you already have should work great. The only other other outputs that you can remove(beside the list of file names) is the job header and summary. This becomes an option for you.

Don't hesitate to use the /Tee option to create your log and visually see in the Command Line the real time results. To do this all you need to do is add /Tee /Log:%Log%

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .