--- /dev/null
+= Linking =
+
+== Re-Link All Bibs Over 1 Week ==
+
+
+[source,sh]
+--------------------------------------------------------------------------
+sudo -u opensrf
+LINK_DIR=/openils/var/data/authority-control/link-bibs
+
+mkdir -p $LINK_DIR
+
+PGPASSWORD=<PASSWORD> ./find-bibs-to-link.pl --db-host <DB-HOST> \
+ --batch-size 5000 --out-dir $LINK_DIR
+
+./link-bib-batches.sh # e.g. via CRON
+--------------------------------------------------------------------------
+
#!/bin/bash
set -eu
PROC_COUNT=3
-BATCHES_PER_PROC=3
-BATCH_DIR="/openils/var/data/linkbibs"
+BATCHES_PER_PROC=9
+BATCH_DIR="/openils/var/data/authority-control/link-bibs"
DOW=$(date +%u);
[ $DOW == 7 ] && DOW=0; # make Sunday = 0
-BATCH=$(echo "$PROC_COUNT * $BATCHES_PER_PROC * $DOW" | bc);
+BATCH_SIZE=$((($PROC_COUNT * $BATCHES_PER_PROC)));
+BATCH=$((($BATCH_SIZE * $DOW)));
echo "Starting at batch number $BATCH";
START=$1
for batch in $(seq 1 $BATCHES_PER_PROC); do
FILE=$(printf "$BATCH_DIR/bib-ids.%0.3d" $((($START + $batch))));
- echo "Linking bib file $FILE"
+ if [ -f $FILE ]; then
+ echo "Linking bib batch file $FILE"
+ else
+ echo "Skipping nonexistent bib link batch file $FILE"
+ continue
+ fi
perl ./authority_control_fields.pl --refresh --file $FILE
done;
}