new utility to overlay bib records in an Evergreen database
authorGalen Charlton <gmc@esilibrary.com>
Tue, 5 Apr 2016 14:24:47 +0000 (10:24 -0400)
committerGalen Charlton <gmc@esilibrary.com>
Tue, 5 Apr 2016 14:24:47 +0000 (10:24 -0400)
commit026123cb2c1de3c71bdfdd5fd99a6d73a36fa6af
treeaa67e35c273654ddc006a6e29d2fc44da174a69c
parenta7680f193c045502b0c0b034891a2ae8e47860ca
new utility to overlay bib records in an Evergreen database

Utility to stage and overlay bib records in an Evergreen database. This
expects that the incoming records will have been previously exported
from that Evergreen database and modified in some fashion (e.g., for
authority record processing) and that the bib ID can be found in the
901$c subfield.

This program has several modes controlled by the --action switch:

  --action stage_bibs  - load MARC bib records into a staging table
  --action filter_bibs - mark previously staged bibs that should
                         be excluded from a subsequent load, either
                         because the target bib is deleted in Evergreen
                         or the record was modified after a date
                         specified by the --cutoff switch
  --action load_bibs   - overlay bib records using a previously staged
                         batch, one at a time. After each bib, it will
                         wait the number of seconds specified by the
                         --wait switch.

Several switches are used regardless of the specified action:

  --schema  - Pg schema in which staging table will live; should be
              created beforehand
  --batch   - name of bib batch; will also be used as the name
              of the staging table
  --db      - database name
  --dbuser  - database user
  --dbpw    - database password
  --dbhost  - database host

Examples:

./eg_staged_bib_overlay --schema bib_load --batch bibs_2016_01 --db evergreen \
   --dbuser evergreen --dbpw evergreen --dbhost localhost \
   --action stage_bibs -- file1.mrc file2.mrc [...]

./eg_staged_bib_overlay --schema bib_load --batch bibs_2016_01 --db evergreen \
   --dbuser evergreen --dbpw evergreen --dbhost localhost \
   --action filter_bibs --cutoff 2016-01-02

./eg_staged_bib_overlay --schema bib_load --batch bibs_2016_01 --db evergreen \
   --dbuser evergreen --dbpw evergreen --dbhost localhost \
   --action load_bibs

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
eg_staged_bib_overlay [new file with mode: 0755]