- Timestamp:
- 30/05/06 19:25:37 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery/trunk/ingestAutomation/OAIBatch/oai_ingest.py
r1045 r1066 18 18 #History: 19 19 # 12/05/06 SEL spelling correction 20 # 20 # 30/05/06 SEL cope with many files for processing."Argument list too long" problem. 21 21 # 22 22 … … 69 69 # Create/clear the directory for a pristine copy of the difs in case the script rewrites something wrong 70 70 if os.path.isdir("/usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy"): 71 commandline = " rm -f /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/*"71 commandline = "ls -1 /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/* | xargs -i rm /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/{\}" 72 72 print "Executing : " + commandline 73 73 status = os.system(commandline) … … 80 80 sys.exit("Failed at creating copy dir stage") 81 81 82 # make the pristine copy 82 # make the pristine copy. Cope with there being lots of files in the directory. 83 83 84 commandline = "ls -1 " + harvest_home + "/ | xargs -i cp \{\} " /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy"84 commandline = "ls -1 " + harvest_home + "/ | xargs -i cp " + harvest_home + "/{\} /usr/local/WSClients/OAIBatch/data/" + datacentre + "/oai/difcopy" 85 85 print "Executing : " + commandline 86 86 status = os.system(commandline) … … 99 99 100 100 # make the processing copy 101 commandline = " cp " + harvest_home + "/*.xml /usr/local/WSClients/OAIBatch/data/" + datacentre +"/discovery"101 commandline = "ls -1 " + harvest_home + "/ | xargs -i cp " + harvest_home + "/{\} /usr/local/WSClients/OAIBatch/data/" + datacentre + "/discovery" 102 102 print "Executing : " + commandline 103 103 status = os.system(commandline) … … 139 139 #the filenames and it will leave <DIF> as the root element. 140 140 # 141 #Once the pre-processing has finished remove the originals from the discovery directory: 142 commandline = " rm /usr/local/WSClients/OAIBatch/data/" + datacentre +"/discovery/oai*"141 #Once the pre-processing has finished remove the originals from the discovery directory: 142 commandline = "ls -1 usr/local/WSClients/OAIBatch/data/" + datacentre +"/discovery/oai* | xargs -i rm usr/local/WSClients/OAIBatch/data/" + datacentre +"/discovery/{\}" 143 143 print "Executing : " + commandline 144 144 status = os.system(commandline) … … 160 160 if status !=0: 161 161 sys.exit("Failed at creating backup directory %s" %this_backupdir) 162 commandline = " cp " + "/usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/*" + this_backupdir162 commandline = "ls -1 /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/ | xargs -i cp /usr/local/WSClients/OAIBatch/data/" + datacentre +"/oai/difcopy/{\}" + this_backupdir 163 163 print "Executing : " + commandline 164 164 status = os.system(commandline)
Note: See TracChangeset
for help on using the changeset viewer.