#!/bin/bash if [ "$#" != 2 ] then echo "Usage: $0 srcLocation destLocation" 1>&2 exit 1 fi DB_SRC="$1" DB_DST="$2" if [ "$DB_SRC" = "$DB_DST" ] then echo "Source and destination are the same: $DB_SRC" exit 1 fi I1="SPO POS OSP" I2="GSPO GPOS GOSP SPOG POSG OSPG" I3="node2id prefixIdx prefix2id" CP="$(make_classpath $TDBROOT)" CP="classes:$CP" function rewrite { local SRC="$1" local DEST="$2" local IDX="$3" java -cp "$CP" -server -Xmx1000M bpt.CmdRewriteIndex "$SRC" "$DEST" "$IDX" } for I in $I1 $I2 #$I3 do echo "Process index $I" rewrite "$DB_SRC" "$DB_DST" "$I" ## mv "$T.idn" "$I.idn" ## mv "$T.dat" "$I.dat" done # Sort out the indexes not processed. cp "$DB_SRC"/*.info "$DB_DST" cp "$DB_SRC"/node2id.* "$DB_SRC"/nodes.* "$DB_DST" cp "$DB_SRC"/prefix2id.* "$DB_SRC"/prefixIdx.* "$DB_SRC"/prefixes.* "$DB_DST" if [ "$DB_SRC"/*.opt != "$DB_SRC/*.opt" ] then cp "$DB_SRC"/*.opt "$DB_DST" fi