Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

avoid existing file details of destination folder in Robocopy log

Tags:

robocopy

I would like to avoid all existing file names and details of destination folder while using Robocopy Log.

Just want to show only copied file list and its details.

So i could save on the robocopy log file size by avoiding existing file details on log.

Is there any option to avoid it, please help out on this

I could not see any option for that

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 percentage 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.
like image 683
Sun_Sparxz Avatar asked Apr 19 '13 15:04

Sun_Sparxz


People also ask

Does robocopy overwrite destination files?

Robocopy normally overwrites those. /XN excludes existing files newer than the copy in the source directory. Robocopy normally overwrites those. /XO excludes existing files older than the copy in the source directory.

Does robocopy keep a log?

Robocopy does not keep a default log file. It does however only copy files with differences by default. So if you tried the same copy again it would skip the ones that had already successfully copied.

How do I use robocopy to only replace changed files?

To copy only changed files with Robocopy, you have two options, namely using maxage: n or /XO /maxage: n. Some users say that they don't want to create all the subfolders on the target disk if there is no new files in them. In this case, you need to add extra switch /S to exclude the empty folder.

Does robocopy create destination folder?

The most basic use of robocopy is using a source and destination directory with no options. This option will copy all files (excluding subfolders) from C:\src to C:\dst.


1 Answers

By default robocopy logs only folders and nonpresent/modified (i.e. copied) files.

          New Dir          2    C:\Temp\a\
100%        New File                   0        bar.txt
100%        New File                   0        foo.txt

You can suppress the logging of folders with the /ndl switch (in this case the copied files will be listed with their full path).

100%        New File                   0        C:\Temp\a\bar.txt
100%        New File                   0        C:\Temp\a\foo.txt

Modify just foo.txt and re-run robocopy a b /ndl and you get

100%        Newer                      3        C:\Temp\a\foo.txt

Add /njh and /njs to remove header and summary from the output. Add /np to remove progress indication (the percent value at the beginning of the output line). Add /xx to remove indication of extra files (files that exist only in the destination, but not in the source folder):

C:\Temp>robocopy a b /njh /njs /ndl /np

          *EXTRA File                  0        C:\Temp\b\baz.txt
            New File                   0        C:\Temp\a\bar.txt
            New File                   0        C:\Temp\a\foo.txt

C:\Temp>echo "foo" >a\bar.txt

C:\Temp>robocopy a b /njh /njs /ndl /np /l

          *EXTRA File                  0        C:\Temp\b\baz.txt
            Newer                      3        C:\Temp\a\bar.txt

C:\Temp>robocopy a b /njh /njs /ndl /np /xx /l

            Newer                      8        C:\Temp\a\bar.txt
like image 183
Ansgar Wiechers Avatar answered Oct 02 '22 20:10

Ansgar Wiechers