0

So, on Windows Server 2019 it looks like you can have multiple backups only to a local disk. To a network location you can have only a single backup at a time. I worked around that by creating a VHDX file on the network location, mount this VHDX file and then setup Windows Server Backup to use that mounted disk as 'local disk' for the backup. This works very well.

Only problem is, that the VHDX gets unmounted if the network goes down and does not remount automatically.

I created a batch script for the remounting:

diskpart /s AutoMount_diskpart.txt >> AutoMount_log.txt
timeout /t 15

with the contents of AutoMount_diskopart.txt being:

select vdisk file = "\\vault\Backup1\CASTLE\WindowsServerBackup.vhdx"
attach vdisk

running the batch file while the disk is already attached doesn't seem to be a problem, as the 'attach vdisk' command in that case simply fails.

What I wonder now is how I can automatically run that batch script each time automatically before windows server backup runs a backup?

matthias_buehlmann
  • 488
  • 1
  • 6
  • 19
  • Schedule it right before scheduling the backup. – Overmind Dec 16 '20 at 13:05
  • Some things that came into my mind: Re-think your solution! Mounting vhdx for backups does not sound very,.. expedient! You can fire of scripts on Windows Events with Taskschd.msc - e.g.: Trigger: "Network Restored" Event – Berndinox Dec 16 '20 at 13:57

0 Answers0