No announcement yet.

Robocopy options...

  • Filter
  • Time
  • Show
Clear All
new posts

  • Robocopy options...


    We run Robocopy to grab userdata from remote locations, but it generates failures from some sites.

    We have identified the reason for this as large .NSF files which wont copy over before the job completes and the backup window closes.

    I am aware of the Exclude option to exclude a specific file types and the Minimum and Maximum file size options. However neither option will meet my requirment (I Need the NSF files and i dont want to exclude any file over X Mb)

    As a result id like to exclude(or skip) .NSF files if they exceed 50 Mb

    Any ideas on if this is a possibility within Robocopy..?


  • #2
    Re: Robocopy options...

    You can use the following option to exclude file of a particular size:

    /MAX:n - Excludes files larger than n bytes.


    • #3
      Re: Robocopy options...

      Unfortunatly i dont want to exclude all files over 50Mb, .

      I need to exclude files of a specific type, if its size exceeds a certain threshold eg:50Mb.



      • #4
        Re: Robocopy options...

        Just a long shot idea, you may want to look into the even more full featured RichCopy utility. I'm not sure if it allows the use of logical operators in the copy string though, which is what it would seem like you're interested in. This isn't exactly a strange request so I'm sure someone out there has the answer.
        Wesley David
        LinkedIn | Careers 2.0
        Microsoft Certifications: MCSE 2003 | MCSA:Messaging 2003 | MCITP:EA, SA, EST | MCTS: a'plenty | MCDST
        Vendor Neutral Certifications: CWNA
        Blog: || Twitter: @Nonapeptide || GTalk, Reader and Google+: [email protected] || Skype: Wesley.Nonapeptide
        Goofy kitten avatar photo from Troy Snow:


        • #5
          Re: Robocopy options...

          Not sure if the workaround below actualy will work. It did worked in a small test environment.

          What this batch does is first running a Robocopy command-line with the /L switch, searching for *.NSF files with a minimum size of 50000000 bytes. It export the results to a RCJ-file in the logs folder.

          Then the actual Robocopy command-line is fired and include the just created list containing the files to exclude.

          Because Robocopy is launced twice it'll take a longer time for the task to complete, depending on the size of the scope. And also, there might be a chance that the list of exclude files could get too large to handle for Robocopy (not sure, these limits are not documented).

          @echo off
          Set "_source=C:\ROBOCOPY tests\SOURCE"
          Set "_destination=C:\ROBOCOPY tests\DESTINATION"
          Set "_log=C:\ROBOCOPY tests\robocopy2.log"
          Set "App_roboCopy=C:\ROBOCOPY tests\robocopy.exe"
          Set "_xF=%_log%\..\eXcludeFiles.RCJ"
          echo\Creating list of files to skip  ...........
          >"%_xF%" Echo\	/XF		:: eXclude Files matching these names
          "%App_roboCopy%" *.NSF /MIN:50000000 /S "%_source%" "%_destination%" /L /NJH /NJS /FP /NC /NS /NDL /LOG+:"%_xF%"
          echo\ & echo\~ Done. ~ & echo\ & echo\
          echo\Running file copy  ........................
          "%App_roboCopy%" *.* /S "%_source%" "%_destination%" /job:"%_xF%" /LOG:"%_log%"

          This posting is provided "AS IS" with no warranties, and confers no rights.


          ** Remember to give credit where credit's due **
          and leave Reputation Points for meaningful posts