Changeset 1579 for TI01-discovery


Ignore:
Timestamp:
12/10/06 19:17:31 (13 years ago)
Author:
selatham
Message:

Changes for upgrade and re-deployment of eXist db in slightly different manner.

Location:
TI01-discovery/trunk/ingestAutomation
Files:
1 deleted
1 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery/trunk/ingestAutomation/exist_backup.py

    r962 r1579  
    33# Usage: exist_backup <database> <target directory> 
    44# 
    5 # Uses  backup_ndg.sh client with the -d dump option to dump the  database to disc. 
     5# Uses  backup.sh client with the -d dump option to dump the  database to disc. 
    66# The directory tree of dumped files is put in 
    77# the target directory and is named using the current date and time. 
     
    1717#   12/05/06 SEL spelling correction 
    1818#   18/05/06 SEL Don't echo the password 
     19#   27/09/06 SEL The eXist db has been deployed differently. The database resides in the usual 
     20#                tomcat webapps directory, but the admin client has also been installed at 
     21#                /usr/local/exist-client for doing command-line backups etc. 
    1922# 
    2023import sys 
     
    2326 
    2427status = 0 
    25 os.putenv ('PATH', '/usr/local/eXist/bin:/bin:/usr/bin:.') 
    26 os.putenv ('EXIST_HOME', '/usr/local/eXist') 
     28os.putenv ('PATH', '/usr/local/exist-client/bin:/bin:/usr/bin:.') 
     29os.putenv ('JAVA_HOME', '/usr/java/jdk1.5.0_03') 
     30os.putenv ('EXIST_HOME', '/usr/local/exist-client') 
    2731 
    28 TMP_DIR = '/usr/local/eXist/backup' 
     32#TMP_DIR = '/usr/local/exist/backup' 
    2933 
     34# replace glue.badc.rl.ac.uk with actual location if different eg. machine.ac.uk or localhost 
    3035if (len(sys.argv) < 3): 
    3136    print "<database> and <target_directory> parameters not supplied - will use defaults" 
    32     database = 'xmldb:exist://localhost:8080/exist/xmlrpc' 
     37    database = 'xmldb:exist://glue.badc.rl.ac.uk:8080/exist/xmlrpc' 
    3338    target_directory = '/disks/glue1/existBackup/dev/data' 
    3439else: 
     
    3641    target_directory = sys.argv[2] 
    3742 
    38 os.chdir('/usr/local/eXist') 
     43os.chdir('/usr/local/exist-client') 
    3944 
    4045date_string = commands.getoutput ("date +'%y%m%d_%H%M'") 
     
    4247print " Backup directory: ", backup_directory 
    4348 
    44 cmd = "/usr/local/eXist/bin/backup_ndg.sh -d /usr/local/eXist/backup -u admin -p xxxxxxx -b /db -ouri=" + database 
     49cmd = "/usr/local/exist-client/bin/backup.sh -d " + backup_directory + " -u admin -p xxxxxxx -b /db -ouri=" + database 
    4550print "Executing: the actual backup command" 
    4651status = os.system (cmd) 
    4752if status != 0: 
    48     sys.exit('FAILED when running the backup command backup_ndg.sh. Status = %s' %status) 
     53    sys.exit('FAILED when running the backup command backup.sh. Status = %s' %status) 
    4954 
    50 cmd = "mkdir " + backup_directory 
    51 print "Executing: ", cmd 
    52 status = os.system (cmd) 
     55#cmd = "mkdir " + backup_directory 
     56#print "Executing: ", cmd 
     57#status = os.system (cmd) 
    5358 
    54 cmd = "cp -R " + TMP_DIR + "/* " + backup_directory  
    55 print "Executing: ", cmd 
    56 status = os.system (cmd) 
     59#cmd = "cp -R " + TMP_DIR + "/* " + backup_directory 
     60#print "Executing: ", cmd 
     61#status = os.system (cmd) 
    5762 
    5863print "eXist_backup script completed " + commands.getoutput ("date +'%y%m%d_%H%M'") 
Note: See TracChangeset for help on using the changeset viewer.