09 July 2006

Syncing directories on windows

Here's a little script that syncs a directory using xxcopy

@echo off
REM /BI Backs up incrementally, different (by time/size) files only.
REM /FFn Treats file times within +/- n sec as the same
REM /ZY Deletes extra files or subdirectories in destination, there is no confirmation prompt.
REM /E Copies directories and subdirectories, including empty ones.
REM /H Copies hidden and/or system files also.
REM /R Overwrites read-only files.
REM /KS Keeps the source attributes including the read-only bit.
REM /ZE Disables the use of all Environment Variables for XXCOPY.
REM /YY No prompting
REM /C Continues copying even if errors occur (default).
REM /Q Does not display files which are skipped.
REM /oA append to log file
REM /X excludes files or directories, e.g.

xxcopy "E:\sekhonp\it\builds\bats-system\" "C:\sekhonp\it\builds\bats-system\" /BI /FF30 /ZY /E /H /R /KS /ZE /YY /C /Q /Xclasses\ /X*\classes\ /Xdecompiledsrc\ /X*\dist\ /X*\build\ /Xlog\ /X*.zip