Camen Design Forum

Backup on Windows utterly sucks and has for decades; can you help?

Kroc

Thanks for the suggestion Johann, that looks very good!
Interesting that this thread has popped back up, I can post the solution I've come up with thus far:

Using "vscsc"[1] and "dosdev"[2] it's possible to create a volume shadow copy from a batch script and mount it as a drive letter. From there, it's just a simple ROBOCOPY, thusly:

% Batch
@ECHO OFF
REM Change directory to where this script is located
CD /d "%~dp0"

IF "%1" == "" (
	REM Create the volume shadow and re-run this script passing the volume identifier
	vscsc -exec="%~0" C:

) ELSE (
	REM Mount the network drive. This assumes the password is the same as your logon account, if not use:
	REM NET USE <drive> <path> /PERSISTENT:NO /USER:<name> <password>
	NET USE T: \\192.168.1.100\Backup /PERSISTENT:NO
	REM Mount the volume shadow as a drive letter
	dosdev B: %1
	
	ROBOCOPY "B:\Users" "T:\Users" /MIR /XJ /R:0 /W:0 /NC /NDL /XF "Desktop.ini" "Thumbs.db"
	
	REM Dismount the volume shadow drive, when this script ends, vscsc will automatically remove the shadow.
	REM NOTE: if you cancel the script whilst running, the shadow might be left behind, run `vscsc -da` to clean up
	dosdev /D B:
	REM Dismount the network drive
	NET USE T: /DELETE
)
%

[1] http://vscsc.sourceforge.net/
[2] http://sourceforge.net/projects/vscsc/files/utilities/dosdev.zip/download

Append

(Leave this as-is, it’s a trap!)

Only the original author or a moderator can append to this post.

Pro tip: Use markup to add links, quotes and more.

Your friendly neighbourhood moderators: Kroc, Impressed, Martijn