Ignore:
Timestamp:
31/03/06 19:15:08 (14 years ago)
Author:
selatham
Message:

clear out old harvests and exit when nothing to harvest

File:
1 edited

Legend:

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

    r721 r741  
    5252datacentre_config_file.close() 
    5353 
    54 # The harvested_records directory 
    55 #harvest_home = "/home/tomcat/oai/WEB-INF/harvested_records/www.npm.ac.uk/8080/oai/provider/rsdas/dif" 
     54if not os.path.isfile(harvest_home + "/*"): 
     55    print "Nothing to harvest this time from %s" %datacentre 
     56    sys.exit() 
    5657 
    5758# The directory to put things for a tape backup (should already exist) 
     
    9798# The file config.properties contains the name=value pair to parse the filename in java oaiProc.jar. 
    9899# Copy the datacentre specific version of config to config.properties file.  
    99 # e.g. for bodc:- 
    100 #cat bodc_config.properties 
    101 #       #### config.properties ####### 
    102 # Define host_OAI as the string that OAI adds to the filenames after harvesting 
    103 # String added by OAI for BODC, SOC, NCAR  
    104 # BODC = oai%3Agrid.bodc.nerc.ac.uk%3A 
    105 # SOC = oai%3Aoai.noc.soton.ac.uk%3A 
    106 # NCAR = oai%3Aucar.ncar.scd.cdp%3A 
    107  
    108 #host_OAI=oai%3Agrid.bodc.nerc.ac.uk%3A 
    109 # 
    110 #               ########### 
    111100 
    112101commandline = "cp /usr/local/WSClients/OAIBatch/" + datacentre +"_config.properties /usr/local/WSClients/OAIBatch/config.properties" 
     
    180169    sys.exit("Failed at copying to backup directory %s" %this_backupdir) 
    181170         
    182      
     171#Clear out the original harvest records area 
     172commandline = "rm -f " +  harvest_home +"/*" 
     173print "Executing : " + commandline 
     174status = os.system(commandline) 
     175if status !=0: 
     176    sys.exit("Failed at clearing out original harvest records area %s" %harvet_home) 
     177 
    183178 
    184179print "======================================================" 
Note: See TracChangeset for help on using the changeset viewer.