RoboCopy
is one of the most efficient solutions to utilize for syncing directories on Windows
- Monitors the source for any changes and logs whenever a file is copied to the destination
- Date & Time: (Locale dependent)
%date%
: Outputs a date in the following format:yyyy.MM.dd
%dtime%
: Outputs time in the following format:HHmmss
- Directories:
%Dest%
: Destination Directory%LogDir%
: Log Directory%Src%
: Source Directory
- RoboCopy:
%log%
: Logging Options, outputs a log file in the following formatYYYY.MM.DD_HHMMSS.log
/ETA
: Show Estimated Time of Arrival of copied files/LOG:
: Output status to LOG file/NP
: No Progress - don't display percentage copied/TEE
: Output to console window, as well as the log file
Helpful if needing to run from a terminal occassionally/TS
: Include source file Time Stamps in the output/V
: Produce Verbose output, showing skipped files
%opt%
: Copy options/MON
: MONitor source; run again when more thann
changes seen/Z
: Copy files in restartable mode
%what%
: What to copy/COPY:DAT
: what to COPY for files (default is/COPY:DAT
)
Copy Flags: D=Data, A=Attributes, T=Timestamps/DCOPY:DAT
: Same as above, except for directories/E
: copy subdirectories, including Empty ones/XD
: EXclude Directories matching given names/paths
Required if Log Directory is stored in the Source directory/XN
: eXclude Newer files
/SAVE
: SAVE parameters to the named job file
Outputs job file to:C:\ProgramData\Scripts\Robocopy\File-Sync.rcj
- Date & Time: (Locale dependent)
- Runs
File-Sync.cmd
with no shell (intended for use when runningFile-Sync.cmd
as a task). To execute:wscript "C:\ProgramData\Scripts\Robocopy\NoShell-RoboCopy.vbs" "C:\ProgramData\Scripts\Robocopy\File-Sync.cmd"
- Task Scheduler task that runs 30s after login