A few weeks back I wrote about deleting files that are in use
What about copying them so you can back them up?
I found a tool that will do just that.
It is called hobocopy.
Not to be confused with robocopy, hobocopy takes advantage of a system within windows called Volume Shadow Copy. This allows you to ‘shadow’ files so you can back them up, even while they are in use.
Normally this is just used by backup apps, or the
“Previous Versions” feature of windows
To get started, visit the hobocopy download page:
Just make sure you get the right one. If you have the 32 bit version of Windows 7..then get the 32 bit version.
The three release versions at the bottom of the page are the ones you want to look at.
If you do download the wrong one, most likely it will return an error when trying to use it. This is because it cannot properly hook into the Volume Shadow Copy system.
Now, on to our task. To copy a folder that contains files that are in use, simply call it like this:
hobocopy [source] [dest]
If you want to get some of the incremental copy features that you see in robocopy, you will first need to make a full copy like this:
hobocopy c:\source c:\dest /statefile=inc.state
This will create a file named inc.state that the incremental copy can use to determine what changed.
Once that full copy is complete, you can run an incremental by referencing the same state file:
hobocopy c:\source d:\dest /statefile=inc.state /incremental
Now it will only copy files that have changed.
One word of warning with all of this. Not all ‘files in use’ are equal. It is possible that the file could be quite old if the application using it never releases its lock.
MSSQL database files fit this description. In addition, applications that don’t properly lock and unlock their files may cause you to copy a file that is in a transient state – in other words corrupted.
Make sure you test this out before someone comes to your desk and asks, “Um, do we backup our files?”
The main hobocopy website can be found here:
One more thing…Subscribe to my newsletter and get 11 free network administrator tools, plus a 30 page user guide so you can get the most out of them. Click Here to get your free tools