Subscribe

Get the Network Administrators tool pack

Subscribe to our 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

Recent Posts

Search

Archives

Copy files that are in use

Post image for Copy files that are in use

by Steve Wiseman on November 2, 2011 · 4 comments

in Backups,BAT Files,Tips,Tools


.

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

Previous Versions

To get started, visit the hobocopy download page:

https://github.com/candera/hobocopy/downloads

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?”

Do we make backups?

The main hobocopy website can be found here:

http://candera.github.com/hobocopy/

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

Related Articles:

{ 4 comments… read them below or add one }

1 Tracy November 2, 2011 at 11:15 am

Awesome! Awesome! Awesome!

Steve I can’t thank you enough for this tip. I have this crusty old application that locks one of its configuration files. For no reason! It does not even write to it, but I want to keep dated copies of this thing and I always have to get everyone to exit out of the app so I can run my backup. Now I can copy all this without bothering anyone.

Just tested and everything is intact. Thanks again

Tracy

2 Mike Ratlidg November 2, 2011 at 11:17 am

Hey Steve. Does this work under Windows 2000? I see downloads for XP, Vista, Windows 7, 2003, 2008. No 2000.

3 Steve Wiseman November 2, 2011 at 11:22 am

Wow. Still got 2000 on your network Eh? Bet that is some important software on that beast, and you can’t get rid of it right?

No…it won’t work on 2000 since that version of Windows does not have the Volume Shadow Copy services needed.

4 Mike Ratlidg November 2, 2011 at 11:24 am

Right on the money steve. It is a Cisco call manager. All phone calls for the entire company go through it! Can’t upgrade since Cisco moved to unix and abandoned their Windows version. Guess what? They want us to pay big $$$ to do the upgrade.

Not going to happen any time soon. Will probably have 2000 on my network for the next 10 years.

Leave a Comment

Category Links - Windows Forum - Exchange Forum