I am disappointed to say that Toucan will not use the Volume Snapshot Service in a future version. The idea behind VSS is that it allows you to copy files which are in use, for example an Outlook .pst file whilst Outlook is open. As there were a number of requests for this feature, and indeed I too thought it would be useful I have had it on the todo list for a while, and indeed I intended to have it added for version 2.1.3 which is now in pre-release here.
Unfortunately however after looking through the VSS SDK and at a number of posts on forums around the internet I have realised it is not as straight forward as I hope to add support to Toucan, a fairly large amount of code would need to be rewritten.
The reason for this is that Toucan uses the wxWidgets library instead of platform specific calls, for example instead of calling the Win32 function CopyFile Toucan calls wxCopyFile which, depending on the platform it is being compiled for ends up as the native file copy call. VSS however requires you to take a snapshot of an entire volume (for example C: or D:) and it then returns a special path to the shdow copy, for example
\\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1. The way Toucan (and I believe wxWidgets) works means it requires filenames such as
C:\test throughout the codebase (this is also the reason that support for UNC paths has not been added). To support this change of filename type would require a substantial amount of time, that I would prefer to devote to other Toucan todo's, which I hope to post about soon!
Thanks for your understanding
P.S. For more info on VSS see this blog post by Craig Andera.
- Steve Lamerton's blog
- Log in or register to post comments
Ok, wmi or windows api's are
Ok, wmi or windows api's are apparently not compatible/easy to implement in combination with wxWidgets.
I think i've found another method that will not require you to do anything with VSS from your code.
It is called vssbackuphelper.
Vssbackuphelper is an open source utility which you can call from your application by a simple cmd (batchfile) command. I presume that wxWidgets is able to call a simple batchfile before it starts to sync/copy files?
Vssbackuphelper even contains a few batchfiles that provide examples of how it works in combination with popular utilties such as Robocopy and Rsync:
You can find more info here:
Let me know if that provides an (alternative) solution for you.
Probably Won't Help
I don't think that would help as the issue doesn't seem to be interfacing with VSS, but using the paths that VSS requires. In our case, Toucan is built to only use regular Windows paths (X:\PathTo\Something) whereas VSS will require UNC paths which are currently unsupported in Toucan (and possibly wxWidgets). Until Toucan gets UNC support, it can't do VSS. That right, Steve?
The beauty of Vsshelper is
The beauty of Vsshelper is that you won't need to specify UNC paths anymore.
This is how it works (from the readme):
1: Takes VSS snapshot
2: Mount snapshot to a drive letter via DefineDosDeviceA API
3: Launches a custom process (in my case a rsync backup)
4: Unmounts the drive letter.
These are the command line parameters:
Util that takes a vss snapshot and mounts it to a drive letter.
Launches a process and after it has executed dismounts the snapshot.
/s "?" volume to take a vss snapshot of, ex: /s "c:\"
/d "?" drive letter used to mount the snapshot, ex: /d "x:\"
/l "?" process to launche after mount, ex: /l "c:\test.exe"
backuphelper /s "C:\" /d "V:\" /l "%cd%\samplebackupJob.cmd"
Ah, that's interesting. Unfortunately, it will require admin rights (mount a drive always does), so I think it will be a no-go at the moment. But I'll wait on Steve's thoughts on whether to include it as an advanced option.
It does not need local
It does not need local administrator rights, backup operator rights will be quite sufficient.
VSS always needs at least backup operator rights to function.
Admin rights not needed
But... You don't need admin rights to mount a drive; you can mount network drives without them?
actually looks really neat (not that I have yet been able to make it work, I get an RPC error at the moment), I didn't know you could assign a drive letter like that.
Because it requires privileges that a number of users may not have and because it requires some very specific services to be running that are not running by default I think I will probably tidy the code up a little (and convert it to c++) and add a simple GUI to it for newer users and release it as a standalone tool, that way people who want to use it and have the rights can, but it doesn't complicate Toucan itself any more!
anyone managed to get this running on Vista? I get the following error:
C:\Users\Steven\Desktop\Sample>backuphelper /s "C:\" /d "V:\" /l "C:\Users\Steve
The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)
Could not create VSS snapshot.
Then the Volume Shadow Copy Service crashes
Just wondered if someone else had any ideas.