Sie sind auf Seite 1von 3

Backupoflockedfilesusingvshadow.exeandrobocopy.

exe

vshadow.exeistheprogramthatcreatesandmanipulatesshadowcopies(orsnapshots)ofanNTFS
volume

Shadowcopiesarevolatileanddonotsurvivereboots,sothebackup(robocopy)takesplaceduringthe
callingofthevshadow.exeprogram.

The4filesneededare:vshadow.exe,robocopy.exe,dosdev.exe,vssexec.cmd.Placethefileswhere
youwant,butvshadow.exeanddosdev.exeneedtobeinyourpath.IputtheminC:\windowsandIput
allmybatchfilesinC:\backup\(asyouwillseebelow).

AbackupofanentireC:\canbeaccomplishedwiththiscommand:
c:\vshadow.exe -script=vss-setvar.cmd -exec=vss-exec.cmd c:

Now,the[script=vsssetvar.cmd]isaninternalparameterinvshadow.exethatgivestheshadowcopy
anidentifierstringsothatadrivelettercanbeassignedtoitwhichallowsrobocopy.exetoaccessthe
files.

The[exec=vssexec.cmd]isaparameterthatcallsthefilevssexec.cmdwhichIcreateandcontains:

begining
call vss-setvar.cmd
@echo off
dosdev B: %SHADOW_DEVICE_1%
robocopy B:\stuff \\backupserver\share /MIR
dosdev -r -d B:
end

Theeventprocessisthis:
Thevshadow.exeprogramcreatesashadowcopy,andthencallsaninternalparameterthatassignsa
variabletotheshadowcopy.Thenthebatchfile[vssexec.cmd]isexecutedwithinvshadow.exewhere
abackuptakesplace.Dosdev.exeassignsadrivelettertotheshadowcopy[B:].Allnormal
robocopy.exeparameterscanbepassedatthistime.Thendosdev.exeremovesthedriveletterand
vshadow.exeisallowedtoexit.

Iliketoinsertapauseattheendofthevssexec.cmdsoIcanseetheresultoftherobocopy.Iremove
thepausewhenIsetthetask[backup.bat]torunautomaticallywiththeWindowsTaskScheduler.

NOTES:Therearedifferentversionsofvshadow.exe(32bit,64bit,workstation,andserver).Thereare
twodirectories(onasystemvolume)thatevenvshadow.execannotcopy.TheyareC:\SystemVolume
Information(forpartitiondata)andC:\Windows\System32\LogFiles\WMI\RtBackup\(forrealtime
backupdata).

Youcandownloadallfourvshadow.exeversions,aswellasdosdev.exefromhere:
http://ithelp.cveg.uark.edu/backup/backup.zip

Thefollowingtwoexamplesarebackupplansthatworkontwo
differentservers.C:\andD:\data\

EXAMPLE1

C:\backup\backup.bat(runsnightlyona32BitServer2008)

begining
@echo off
vshadow32.exe -script=vss-setvar.cmd -exec=C:\backup\vss-exec.cmd C:
exit 0
end

C:\backup\vssexec.cmd(justatextfile)

begining
call vss-setvar.cmd
@ECHO OFF
dosdev B: %SHADOW_DEVICE_1%
robocopy B:\ \\ip-of-server\backup\c-drive *.* /XJD /XD
"B:\Windows\System32\LogFiles\WMI\RtBackup" "B:\System Volume
Information" /XF "pagefile.sys" /MIR
dosdev -r -d B:
end

***Therobocopystuff/MIRcommandisallononeline***

Therobocopyoptionsareexplainedhere:
*.*=copyallfiles
/XJD=excludeVistaandServer2008junctionpointdirectory(accessdeniedproblems)
/XDB:\firstfolderB:\secondfolder=excludethelistedfolders
/XFpagefile.sys=excludebackingupthepagefile
/MIR=makethebackupmirrorthesourcefiles

EXAMPLE2

C:\backup\backup.bat(runsnightlyona64BitServer2008)

begining
@echo off
vshadow64.exe -script=vss-setvar.cmd -exec=C:\backup\vss-exec.cmd D:
exit 0
end

C:\backup\vssexec.cmd(justatextfile)

begining
call vss-setvar.cmd
@ECHO OFF
dosdev B: %SHADOW_DEVICE_1%
robocopy B:\data\ \\ip-of-server\backup\d-drive\data *.* /mir
dosdev -r -d B:
end

Thishashelpedmeprovideaninexpensivebackupplan.Hopeithelpssomeoneelsetoo.

Anyimprovements(ormistakesIvemade)arewelcomekendall@uark.edu

Das könnte Ihnen auch gefallen