lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <>
Subject Re: problem about backup index file
Date Thu, 25 Feb 2010 15:19:59 GMT
This is likely happening because you're attempting to copy a file that
IndexWriter is currently writing?

You shouldn't do that (copy files that are still being written) --
that just wastes bytes (they aren't used by the index), and causes
this failure on Windows.

Instead, you should use SnapshotDeletionPolicy -- it tells you
specifically which files make up the latest commit point.  Those files
will not be opened for writing (only for reading, if you have an
IndexReader open on that commit) and they should copy just fine on

The "Hot backups with Lucene" article (NOTE: I'm the author) in
upcoming Lucene in Action 2 revision shows how to do this -- it's
available for download from


On Thu, Feb 25, 2010 at 3:15 AM,  <> wrote:
> I want backup my index file,but I get the follow error.
>;another program lock the file!&nbsp;at
Method)&nbsp;at Source)&nbsp;at com.common.Utils.copyDirectory(;at
com.common.Utils.copyDirectory(;at com.common.Utils.copyDirectory(;at
com.index.IndexManager.backDataPolicy(;at com.index.IndexManager.indexLoop(;at
com.Main$;at Source)
> &nbsp;
> How can I backup lucene file in IR thread.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message