Changeset 1880 for TI01-discovery


Ignore:
Timestamp:
15/12/06 19:00:05 (13 years ago)
Author:
selatham
Message:

putting all new parts in

File:
1 edited

Legend:

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

    r1869 r1880  
    174174# Then run the minimum moles creator  which will run over all records in the supplied collection 
    175175# creates a directory ./DIF2MOLES to pass back records with original filename 
    176 commandline = "java -jar d2b.jar repositoryID " +datacentre_namespace+" repositoryLocalID "+datacentre+" format "+datacentre_format+" repository xmldb:exist://glue.badc.rl.ac.uk:8080/exist/xmlrpc userpw secret targetCollection /db/discovery/original/"+format+"/"+datacentre_namespace 
     176commandline = "java -jar d2b.jar repositoryID " +datacentre_namespace+" repositoryLocalID "+datacentre+" format "+datacentre_format+" repository xmldb:exist://glue.badc.rl.ac.uk:8080/exist/xmlrpc userpw xxxxxx targetCollection /db/discovery/original/"+datacentre_format+"/"+datacentre_namespace 
    177177print commandline 
    178178status= os.system(commandline) 
     
    180180    print "ERROR: couldn't create the minimum moles records" 
    181181    sys.exit 
     182 
     183# ingest the created discovery minimum molesrecords into eXist db. 
     184commandline = "$EXIST_HOME/bin/client.sh -c ./DIF2MOLES -u admin -P xxxxxx -p ./DIF2MOLES" 
     185print "Executing : actual command to ingest into exist db" 
     186status = os.system(commandline) 
     187if status !=0: 
     188    sys.exit("Failed at ingesting into exist db. Datacentre =  %s. Status = %s" %(datacentre,status)) 
    182189 
    183190#Extract the spatiotemporal info from created moles and put in Postgres db 
     
    188195    print "ERROR: SpaceTimeIngestFromMOLES failed. Carrying on to do backups" 
    189196 
    190 #Make copies of discovery and oai/originals areas to backup area for tape backups 
     197#Make copies of discovery and oai/originals and DIF2MOLES areas to backup area for tape backups 
    191198this_backupdir = backupdir + datacentre + "_" + date_string + "_originals" 
    192199commandline = "mkdir " + this_backupdir 
     
    215222    sys.exit("Failed at copying to backup directory %s" %this_backupdir) 
    216223 
    217 #Clear out the original harvest records area 
     224this_backupdir = backupdir + datacentre + "_" + date_string + "_DIF2MOLES" 
     225commandline = "mkdir " + this_backupdir 
     226print "Executing : " + commandline 
     227status = os.system(commandline) 
     228if status !=0: 
     229    sys.exit("Failed at creating backup directory %s" %this_backupdir) 
     230 
     231commandline = "ls -1 ./DIF2MOLES | xargs -i cp ./DIF2MOLES{\} " + this_backupdir 
     232print "Executing : " + commandline 
     233status = os.system(commandline) 
     234if status !=0: 
     235    sys.exit("Failed at copying to backup directory %s" %this_backupdir) 
     236 
     237#Clear out the original harvest records area and DIF2MOLES 
    218238commandline = "ls -1 " + harvest_home + " | xargs -i rm " + harvest_home + "/{\}" 
    219239print "Executing : " + commandline 
     
    222242    sys.exit("Failed at clearing out original harvest records area %s" %harvest_home) 
    223243 
     244commandline = "ls -1 ./DIF2MOLES | xargs -i rm ./DIF2MOLES/{\}" 
     245print "Executing : " + commandline 
     246status = os.system(commandline) 
     247if status !=0: 
     248    sys.exit("Failed at clearing out DIF2MOLES area %s" %harvest_home) 
     249 
     250#remove the DIF2MOLES directory 
     251commandline = "rmdir ./DIF2MOLES" 
     252print "Executing : " + commandline 
     253status = os.system(commandline) 
     254if status !=0: 
     255    sys.exit("Failed at removing DIF2MOLES directory %s" %harvest_home) 
    224256 
    225257print "======================================================" 
Note: See TracChangeset for help on using the changeset viewer.