0

I'm trying to build Robocopy scripts to replicate my old synctoy but I seem to have something wrong with my syntax.

With the below command I want to exclude ..\local settings\Temp and ... \local settings\Application Data I'm also trying to /Purge the destination NAS of those directories.

robocopy C:\users\dancedad \\dancedadnas\workbackups\Laptop /mir /XD /e "C:\Users\dancedad\AppData" /z /mt:16 /w:5 /r:3 /XD "C:\users\dancedad\Local Settings\Temp" /XD "C:\users\Dancedad\Local Settings\Application Data" /XF *.tmp /PURGE /log:C:\users\Dancedad\documents\robolog.txt /SAVE:LaptopSync

The output robolog.txt seems to show the Exc Directories, but then when you look at the log, it is still mirroring from that path? And instead of purging, I'm getting *Extra Dir entries.

>-------------------------------------------------------------------------------
>   ROBOCOPY     ::     Robust File Copy for Windows                              
>-------------------------------------------------------------------------------
>
>  Started : Tuesday, May 16, 2023 07:31:08
>   Source : C:\users\DanceDad\
>     Dest : \\DanceDadNas\workbackups\Laptop\
>
>    Files : *.*
>       
>Exc Files : *.tmp
>       
> Exc Dirs : C:\Users\DanceDad\AppData
>       C:\users\DanceDad\Local Settings\Temp
>       C:\users\DanceDad\Local Settings\Application Data
>       C:\users\DanceDad\Application Data\discord
>       
>  Options : *.* /S /E /DCOPY:DA /COPY:DAT /PURGE /MIR /Z /MT:16 /R:3 /W:5 
>
>------------------------------------------------------------------------------
>       Newer                865    C:\users\DanceDad\My Documents\robolog.txt
>100%  
>
>     *EXTRA File         189753    \\DanceDadNas\workbackups\Laptop\.cisco\vpn\log\UIHistory_20230515_162859_log.txt
>       Newer                157    C:\users\DanceDad\Application Data\Slack\local-settings.json
>100%  
>       Newer                  0    C:\users\DanceDad\Dropbox\.dropbox.cache\marker_file
>100%  
>       Newer                 64    C:\users\DanceDad\Local Settings\ESRI_Licensing\README.txt
>100%  
>       Newer             821425    C:\users\DanceDad\Local Settings\Discord\Discord_updater_rCURRENT.log
>100%  
>       Newer             225280    C:\users\DanceDad\Local Settings\Discord\installer.db
>100%  
>       Newer             364757    C:\users\DanceDad\Local Settings\LogiOptionsPlus\settings.backup
>100%  
>       Newer             364782    C:\users\DanceDad\Local Settings\LogiOptionsPlus\settings.json
>100%  
>   *EXTRA Dir        -1    \\DanceDadNas\workbackups\Laptop\Local Settings\Temporary Internet Files\Content.IE5\KF34TA3A\
>   *EXTRA Dir        -1    \\DanceDadNas\workbackups\Laptop\Local Settings\Temporary Internet Files\IE\KF34TA3A\
>   *EXTRA Dir        -1    \\DanceDadNas\workbackups\Laptop\Local Settings\Temporary Internet Files\Content.IE5\L3QGXQV9\
>   *EXTRA Dir        -1    \\DanceDadNas\workbackups\Laptop\Local Settings\Temporary Internet Files\IE\L3QGXQV9\
>       Newer             159744    C:\users\DanceDad\Local Settings\WebEx\CiscoMeetings.db
>100%  
>       Newer              10354    C:\users\DanceDad\Recent\CustomDestinations\a55ed4fbb973aefb.customDestinations-ms
>100%  
>       Newer                 24    C:\users\DanceDad\Recent\CustomDestinations\f18460fded109990.customDestinations-ms
>100%  
>       Newer               2246    C:\users\DanceDad\Application Data\Microsoft\Credentials\FB4C8F2787CF103F364B7EC977B70EED
>100%  
>       Newer             16.2 m    C:\users\DanceDad\Application Data\Microsoft\Teams\logs.txt

1 Answer 1

0

The /e must not be between /XD and the path to exclude:

robocopy ... /XD /e "C:\Users\dancedad\AppData" ...

As you obviously intent to create empty directories this probably has been your intention:

robocopy ... /e /XD "C:\Users\dancedad\AppData" ...

and results in:

robocopy C:\users\dancedad \\dancedadnas\workbackups\Laptop /mir /e /XD "C:\Users\dancedad\AppData" /z /mt:16 /w:5 /r:3 /XD "C:\users\dancedad\Local Settings\Temp" /XD "C:\users\Dancedad\Local Settings\Application Data" /XF *.tmp /PURGE /log:C:\users\Dancedad\documents\robolog.txt /SAVE:LaptopSync
0

You must log in to answer this question.

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