Can cwRsync copy files in use ?

NB! The recipe below applies to Windows 2003 Server only.

I recently had the issue of running rsync to backup up files that are "in use". A good example was backing up documents and settings and the ntuser.dat file would always fail.along with several other system locked files.

Resolution was to download the VSS SDK from Microsoft's web site. The SDK has an executable vshadow.exe which will allow you to create volume shadow copies that are mapped to a drive, allowing rsync to use the VSS drive where no files are locked.


An example command set would be:

rem create a permanent shadow copy
vshadow.exe -p -nw -script=vars.bat
call vars.bat
rem drive H: is assigned to the permanent shadow copy created
vshadow.exe -el=%SHADOW_ID_1%,H:
rem perform your rsync operation, use drive H: (shadow drive) as source
rsync.exe -ruztiv '/cygdrive/h/xxxxxxx' myrsyncserver::myrsyncuser
rem remove the permanent shadow copy
vshadow.exe -ds=%SHADOW_ID_1%


-- Contributed by Rob Bosch

You may also visit this link for more detailed information.