You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uima.apache.org by de...@apache.org on 2016/10/03 18:44:16 UTC
svn commit: r1763191 - /uima/uima-ducc/trunk/src/main/admin/db_tool
Author: degenaro
Date: Mon Oct 3 18:44:15 2016
New Revision: 1763191
URL: http://svn.apache.org/viewvc?rev=1763191&view=rev
Log:
UIMA-5122 Database (db) admin tool for save and restore
Modified:
uima/uima-ducc/trunk/src/main/admin/db_tool
Modified: uima/uima-ducc/trunk/src/main/admin/db_tool
URL: http://svn.apache.org/viewvc/uima/uima-ducc/trunk/src/main/admin/db_tool?rev=1763191&r1=1763190&r2=1763191&view=diff
==============================================================================
--- uima/uima-ducc/trunk/src/main/admin/db_tool (original)
+++ uima/uima-ducc/trunk/src/main/admin/db_tool Mon Oct 3 18:44:15 2016
@@ -20,6 +20,7 @@
import glob
import os
+import socket
import subprocess
import sys
import tarfile
@@ -128,17 +129,27 @@ class DbTool(DuccUtil):
epilog = epilog + 'Example:'
epilog = epilog + '\n'
epilog = epilog + 'bash-4.1$ ./db_tool --save-overwrite /backups/ducc/ducc-db.tar.gz'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:25,938 I save-overwrite'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:28,570 I Uptime (seconds) : 506'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:28,571 I database is up'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:28,571 I remove snapshot'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:31,152 I create snapshot'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:34,002 I remove /home/degenaro/ducc-db.tar.gz'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:34,015 I create /home/degenaro/ducc-db.tar.gz'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:34,499 I count[files]=303'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:34,499 I size[bytes]=177844'
+ epilog = epilog + '\n'
epilog = epilog + '2016-09-30 14:05:34,499 I processing completed successfully'
- print epilog
+ epilog = epilog + '\n'
return epilog
# parse command line
@@ -430,10 +441,16 @@ class DbTool(DuccUtil):
self.extract_targz()
self.complete()
+ # record hostname where invoked
+ def hostname(self):
+ text = 'host='+socket.gethostbyaddr(socket.gethostname())[0]
+ self.logger.info(text)
+
# --save or --save-overwrite or --restore or --restore-overwrite
def main(self, argv):
self.parse(argv)
self.logger = Logger(self.options)
+ self.hostname()
if(self.options.var_save != None):
self.save_virgin()
elif (self.options.var_save_overwrite != None):