Simple Backup unter Hyper-V
3 Dateien, 1 Scheduled Task
o - Config-File f. DiskShadow o
-
eigentliches Sichern o
-
Config-File f. ShadowClean
Config-FIle:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# DiskShadow script file to backup VM from a Hyper-V host
# First, delete any shadow copies of the drives. System Drives needs to be included.
Delete Shadows volume C:
Delete Shadows volume A:
#Ensure that shadow copies will persist after DiskShadow has run set context persistent
# make sure the path already exists
set verbose on
begin backup
add volume A: alias VirtualDisk
add volume C: alias SystemDrive
# verify the "Microsoft Hyper-V VSS Writer" writer will be included in the snapshotwriter verify {66841cd4-6ded-4f4b-8f17-fd23f8ddc3de}
create
end backup
# Backup is exposed as drive X: make sure your drive letter X is not in use
Expose %VirtualDisk% X:
Exit
1
2
3
4
VirtualDisk wieder wegwerfen
# DiskShadow script file to unexpose X:
Unexpose X:
Exit
Und das nun in ein Backup-Skript hinein
1
2
3
4
5
6
7
8
9
10
11
12
13
diskshadow -s "%~dp0vmbup-paiha.start"
REM
REM Danach noch backup verschieben zb
REM robocopy x:\virtualmachines \\backupsvr\virtual-machines\hostserver /mir
REM
REM Once you are sure that you have made copies of your virtual machine, remove
the expose X drive.
REM unexpose X:
REM beim Copy von ganzen Volumes mit
REM /XD "System Volume Information" $RECYCLE.BIN
robocopy x:\Ubuntu a:\Ubuntu /MIR
diskshadow -s "%~dp0vmbup-paiha.finish"
Dieser Eintrag ist vom Autor unter
CC BY 4.0
lizensiert.