runHarvestAndStatistics.sh 1.01 KB
#!/bin/bash

DATE=$(date +%F_%X)
cd "$(dirname $0)/../"

if [ $# -eq 1 ]  && [ "$1" == "force" ]; then
	echo "Harvest mode: force"
#	ant -Dselector=include -Dselector_value="arca rispa" force_harvest 1>>./logs/harvest/log_harvest_$DATE.log 2>>./logs/harvest/log_harvest_$DATE.log 
#	ant -Dselector=exclude -Dselector_value="arca" force_harvest 1>>./logs/harvest/log_harvest_$DATE.log 2>>./logs/harvest/log_harvest_$DATE.log 
	ant -Dselector=exclude -Dselector_value="sinbad" force_harvest 1>>./logs/harvest/log_harvest_$DATE.log 2>>./logs/harvest/log_harvest_$DATE.log
	./scripts/executeMainFromClass.sh pt.keep.metarepository.core.solr.SolrClientUtilities optimize
else
	echo "Harvest mode: normal"
	ant -Dselector=exclude -Dselector_value="sinbad" harvest 1>>./logs/harvest/log_harvest_$DATE.log 2>>./logs/harvest/log_harvest_$DATE.log
	./scripts/executeMainFromClass.sh pt.keep.metarepository.core.solr.SolrClientUtilities optimize
fi

ant statistics 1>>./logs/statistics/log_statistics.log 2>>./logs/statistics/log_statistics.log