Skip to content

Instantly share code, notes, and snippets.

@divsyd
Created August 30, 2017 00:15
Show Gist options
  • Save divsyd/71cfdbeb09cf2463045f87919dbb4531 to your computer and use it in GitHub Desktop.
Save divsyd/71cfdbeb09cf2463045f87919dbb4531 to your computer and use it in GitHub Desktop.
PS C:\temp> "hello" | Out-File C:\temp\source\TestFile.txt
PS C:\temp> & robocopy /e /xo .\source\ .\dest\
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Wednesday, 30 August 2017 10:11:43 AM
Source : C:\temp\source\
Dest : C:\temp\dest\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /XO /R:1000000 /W:30
------------------------------------------------------------------------------
1 C:\temp\source\
100% New File 16 TestFile.txt
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 1 1 0 0 0 0
Bytes : 16 16 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Wednesday, 30 August 2017 10:11:43 AM
PS C:\temp> "updating dest file" | Out-File C:\temp\dest\TestFile.txt
PS C:\temp> & robocopy /e /xo .\source\ .\dest\
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Wednesday, 30 August 2017 10:12:16 AM
Source : C:\temp\source\
Dest : C:\temp\dest\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /XO /R:1000000 /W:30
------------------------------------------------------------------------------
1 C:\temp\source\
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 1 0 1 0 0 0
Bytes : 16 0 16 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Wednesday, 30 August 2017 10:12:16 AM
PS C:\temp> # You can see above the file is skipped.
PS C:\temp> & robocopy /e .\source\ .\dest\
-------------------------------------------------------------------------------
ROBOCOPY :: Robust File Copy for Windows
-------------------------------------------------------------------------------
Started : Wednesday, 30 August 2017 10:12:43 AM
Source : C:\temp\source\
Dest : C:\temp\dest\
Files : *.*
Options : *.* /S /E /DCOPY:DA /COPY:DAT /R:1000000 /W:30
------------------------------------------------------------------------------
1 C:\temp\source\
100% Older 16 TestFile.txt
------------------------------------------------------------------------------
Total Copied Skipped Mismatch FAILED Extras
Dirs : 1 0 1 0 0 0
Files : 1 1 0 0 0 0
Bytes : 16 16 0 0 0 0
Times : 0:00:00 0:00:00 0:00:00 0:00:00
Ended : Wednesday, 30 August 2017 10:12:43 AM
PS C:\temp> # File copied once xo flag is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment