使用VShadows恢复文件不起作用

我一直在开发一个基于这个微软样本的vss-writer。

一开始我使用BETest.exe来testing我的应用程序

> betest.exe /B /S backup.xml /DC:\BackupDestination /X BetestSample.xml > betest.exe /R /S backup.xml /DC:\BackupDestination /X BetestSample.xml 

它工作正常。 我以前可以:

  • 从c:\ testPath备份文件
  • 删除它们
  • 还原它们(到选定的备用位置c:\ testPath2。)

但只要我试图备份/恢复一个10GB的文件,BETest崩溃的恢复操作。 每次。 我看了其他工具:

  • vshadow的
  • VSSADMIN
  • WBADMIN

用VShadow,我键入:

 > vshadow -p -t=c:\bc.xml c: 

我可以看到我的Writer打印:

 enter: DepWriter::Initialize enter: DepWriter::OnIdentify enter: DepWriter::OnPrepareBackup enter: DepWriter::OnPrepareSnapshot enter: DepWriter::OnFreeze enter: DepWriter::OnThaw enter: DepWriter::OnPostSnapshot enter: DepWriter::OnIdentify enter: DepWriter::OnBackupComplete enter: DepWriter::OnBackupShutdown 

我可以使用MKLink链接影子副本并浏览它:

 > mklink /D c:\snapshots \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy6\ 

我可以看到我想备份的文件。

然后我input:

 > vshadow -r=c:\bc.xml 

输出包含(除其他外):

 Sending the PreRestore event ... (Waiting for the asynchronous operation to finish...) Set restore status for all components components for restore... * Writer 'DFS Replication service writer': - Select component \SYSVOL\3E53186A-7D53-4667-A3D1-D278B3564CDC-DF424FA9-3080-403E-B7CE-2A81A03A79FA * Writer 'MSDNSampleWriter': - Select component \TestFiles Sending the PostRestore event ... Restore done. 

我得到了我的作家印刷印刷:

 enter: DepWriter::OnIdentify enter: DepWriter::OnPreRestore enter: DepWriter::OnPostRestore 

但是在c:\ testPath或c:\ testPath2中没有任何文件。 他们没有恢复。



我的VSS Writer是来自MSDN的示例Writer的直接静音,它对小文件的testing效果很好。

为什么V阴影无法恢复我的文件,并告诉它完成? 我在Windows Server 2008 R2 64位上使用它

我find了一个方法…

需要使用exec = {command}开关。

在我的情况下命令是一个简单的:

 vshadow -p -t=c:\bc.xml -exec="robocopy pathA pathB" 

我想正常的请求者会做比这更聪明的东西。 最有可能的是,它会自己find替代的位置,在失败的情况下有一个策略…但是到目前为止,我还不能找出比vshadow更好的工具。

https://msdn.microsoft.com/en-us/library/windows/desktop/aa384575%28v=vs.85%29.aspx