Kohei Nozaki's blog

Derby database backup script

As Roller, and a virtual machine on VMware Fusion, I wrote an another Ant script which backups an Apache Derby database to automate backup of data of my Apache James server. the script has easy purge function as a target named purge too. intended environment is as follows:

Linux server

Accepts connection via ssh

Has executable ij command which is simple CLI JDBC frontend program shipped with Derby

Requires Derby instance to listen a port

It works as follows:

Invoke SYSCS_UTIL.SYSCS_FREEZE_DATABASE() with ij to freeze the database

Create a tarball of the database

Invoke SYSCS_UTIL.SYSCS_UNFREEZE_DATABASE() with ij to unfreeze the database

Download the tarball

Delete the tarball

A bad thing is that due to lack of streaming download in sshexec task, it needs extra free space on the server. the script can be obtained from my GitHub repository.