Derby database backup script
TweetPosted on Friday Feb 20, 2015 at 02:49PM in Technology
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()
withij
to freeze the database -
Create a tarball of the database
-
Invoke
SYSCS_UTIL.SYSCS_UNFREEZE_DATABASE()
withij
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.