The /MIR switch is NOT a two way synchronization. Right from the Microsoft documentation, it tells you /MIR is /e + /purge. It does not delete files from the source. The /MOV option DOES delete files from the source because you are moving them from the source to the destination.
C:\>robocopy C:\cmdCheckCaMainPID c:\Temp /s *.txt /MIR
robocopy c:\Sourcepath c:\Destpath /E /XC /XN /XO
To elaborate:
/E
makes Robocopy recursively copy subdirectories, including empty ones./XC
excludes existing files with the same timestamp, but different file sizes. 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. Robocopy normally overwrites those.
With the Changed, Older, a
Set dd=%date:~7,2%
Set yyyy=%date:~10,4%
Set Year=%date:~10,4%
robocopy C:\Temp\VAE C:\Temp\VAE_Archive /MIR >> c:\Temp\%Year%-%mm%-%dd%-%yyyy%.log
set tdate=%tdate:/=%
set ttime=%time::=%
set ttime=%ttime:.=%
set ttime=%ttime: =%
robocopy C:\Temp\VAE C:\Temp\VAE_Archive /MIR >> c:\Temp\%tdate%-%ttime%.log
沒有留言:
張貼留言
注意:只有此網誌的成員可以留言。