Thank you for this tip.
I do not feel confident with whole DB freeze, as I do not know DB size,
thus I can't estimate the time required to copy files. Also I fear something
goes wrong and UNFREEZE is never called.
In case, is restarting the Derby server sufficient to "forget" this frozen state ?

Doc says that "Derby might block applications that attempt to write to
a frozen database" : is it possible to explain exactly under which circumstances
the writer would be blocked ?

Regarding my initial question : is there somewhere a file to watch
that indicates that server is fully shutdown ?
There is probably a kind of lock file that indicates that a DB is being used ?
Watching server process in /proc would be ugly and not portable.

M. Maison


Le 31/07/2012 22:59, José Ventura a écrit :
I'm using the tips in this page to achieve a similar goal:

http://db.apache.org/derby/docs/10.6/adminguide/cadminhubbkup75469.html

Basically, instead of shutting down the server, you use a command to freeze the DB, then copy the files, then unfreeze the DB. The freeze call will block until it is safe to copy the files.

On Tue, Jul 31, 2012 at 5:49 PM, Mo Maison <momaison@yahoo.fr> wrote:
Hello Derby users,

I encounter sometimes a problem during cold backups :
Derby is launched as a server (listening localhost only ) ;
I stop the network server with standard command :
  java -cp ... \
  org.apache.derby.drda.NetworkServerControl shutdown \
  -h localhost -p 1527

Right after command has returned, I perform a tar of the
database files.
However, I have observed that, on a slow filesystem, somes
files get deleted while tar is reading them. Which let me think
that server is not fully stopped when process returns
(and thus backup may be corrupted).

Is that expected ?
How can I be sure that everything is quiescent before performing
the cold backup ?
I use Derby 10.6.2 on 32 bits Linux.

Thank you for your advices,

 M. Maison