ExtensionCrawler/scripts/merge_each_db.sge

25 lines
676 B
Bash
Executable File

#!/bin/bash
#
#$ -t 1-256
#$ -j yes
#
# Example invocation:
# qsub merge_each_db DBDIR OUTDBPATH EXTENSIONCRAWLERPATH
# DBDIR base dir for the generated db files
# OUTDBPATH path containing the three-letter-dirs
# EXTENSIONCRAWLERPATH ExtensionCrawler git repo
DBDIR="$1"
OUTDBPATH="$2"
EXTENSIONCRAWLERDIR="$3"
source "$EXTENSIONCRAWLERDIR/scripts/sge_common"
load_python
override_vars
set -u
find "$DBDIR" -name "$(task_id_to_letter_256 $SGE_TASK_ID)*.sqlite" -print0 | while IFS= read -r -d '' file; do
DBNAME=$(basename "$file")
"$EXTENSIONCRAWLERDIR/scripts/merge_dbs" "$file" "$OUTDBPATH/${DBNAME:0:3}/$DBNAME"
done