locked
Robocopy /XD proper usage when looking for folder names in random locations RRS feed

  • Question

  • Hello, I am trying to exclude random folders during a backup using the /XD option in Robocopy, but while Robocopy shows they will be Excluded, they are not, the command I am using is below and most articles I read say to use the complete path. But these are users Home Folders and nothing is in a standard location, so explicitly identifying each full path would be a nightmare. Any help would be greatly appreciated.

    robocopy \\prlaw.local\dfs\Home I:\G_HOME_FOLDERS /MIR /XA:H /XO /XD "BlackBerry" "cache" "Cookies" "DfsrPrivate" "__DFSR_DIAGNOSTICS_TEST_FOLDER__" "Downloads" "Dropbox" "Fax" "History" "Old Computer" "iTunes" "Music" "My Music" "My PaperPort Documents" "My Data Sources" "Outlook Files" "ProfileData" "$Recycle.Bin" "Temp" "Windows" "WordPerfect" "Videos" /XA:ST /XJ /XF "*.bak" "*.ini" "*.pst" "*.mp4" "*.EXE" "*.ZIP" "*.DLL" "*.PS1" "*.RDP" "*.REG" "*.TMP" "*.WPD" /XX /COPY:DAT /ZB /MT /R:3 /W:1 /log:homefolders.log

    -------------------------------------------------------------------------------
       ROBOCOPY     ::     Robust File Copy for Windows                              
    -------------------------------------------------------------------------------

      Started : Sun Oct 22 11:12:21 2017

       Source : \\prlaw.local\dfs\Home\
         Dest : I:\G_HOME_FOLDERS\

        Files : *.*
        
    Exc Files : *.bak
        *.ini
        *.pst
        *.mp4
        *.EXE
        *.ZIP
        *.DLL
        *.PS1
        *.RDP
        *.REG
        *.TMP
        *.WPD
        
     Exc Dirs : BlackBerry
        cache
        Cookies
        DfsrPrivate
        __DFSR_DIAGNOSTICS_TEST_FOLDER__
        Downloads
        Dropbox
        Fax
        History
        Old Computer
        iTunes
        Music
        My Music
        My PaperPort Documents
        My Data Sources
        Outlook Files
        ProfileData
        $Recycle.Bin
        Temp
        Windows
        WordPerfect
        Videos
        
      Options : *.* /S /E /COPY:DAT /PURGE /MIR /ZB /XX /XO /XJ /XA:SHT /MT:8 /R:3 /W:1 

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

    Sunday, October 22, 2017 4:28 PM

Answers

  • Looks like the Xcopy is the better option, thanks for the suggestion, the Exclude.txt file should meet my needs with the Wildcard options
    • Marked as answer by dking43 Thursday, October 26, 2017 1:57 PM
    Thursday, October 26, 2017 1:57 PM

All replies

  • Hi,

    According to following article, /xd command would exclude directories that match the specified names and paths. So it needs full path.

    I‘d suggest you to type the command with the full path in a .txt file. It is convenient for you to copy and paste the path. Then you could copy this command in Command Prompt.

    Robocopy:

    https://technet.microsoft.com/en-us/library/cc733145(v=ws.10).aspx


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    • Edited by Vera Hu Tuesday, October 24, 2017 8:23 AM
    Tuesday, October 24, 2017 8:22 AM
  • Best bet,use:  XCOPY  instead,its already installed to Win 7..TechNet describes the cmds in: bb491035
    Tuesday, October 24, 2017 7:36 PM
  • Hi, 

    Hows everything going? Please feel free to give me any update.


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, October 26, 2017 8:56 AM
  • Sorry for the delay, if I have to explicitly name every folder, it would take forever, so robocopy is of no use in this situation, which seems odd, I can't be the first person to request this. When backing up folders how would you know the  exact location unless you printed out a report of the folder listings.

    I will have to look into the Xcopy options to exclude folders. thanks 

    Thursday, October 26, 2017 1:30 PM
  • Looks like the Xcopy is the better option, thanks for the suggestion, the Exclude.txt file should meet my needs with the Wildcard options
    • Marked as answer by dking43 Thursday, October 26, 2017 1:57 PM
    Thursday, October 26, 2017 1:57 PM