X-Git-Url: https://git.sitka.bclibraries.ca/gitweb/?p=sitka%2Fsitka-tools.git;a=blobdiff_plain;f=marc_export_custom%2Frunscript.sh;h=14b6c7a1ad6639e068bec5f10c94484e415c88a8;hp=e44255878eff8181e078090d38b50dfa4b6e912a;hb=ee3af4b3bafbbe5aa158b87dce8b487daa4cf11f;hpb=5e0c5c3f9f295edc5c23ffb1ee095bcd9c394595 diff --git a/marc_export_custom/runscript.sh b/marc_export_custom/runscript.sh index e442558..14b6c7a 100755 --- a/marc_export_custom/runscript.sh +++ b/marc_export_custom/runscript.sh @@ -1,17 +1,14 @@ -echo create table with bib ids for records with no items -psql -h db1.sitka.bclibraries.ca -U evergreen -f getbibidswithnoitems.sql - echo output bib ids for regular bibs to file -psql -h db1.sitka.bclibraries.ca -U evergreen -A -t -c 'select distinct record from asset.call_number where deleted is false and owning_lib between 39 and 46 order by record' > bibids +psql -h db1.sitka.bclibraries.ca -U evergreen -A -t -c "select distinct record FROM asset.call_number where owning_lib in (select distinct id from actor.org_unit_descendants(39)) and not deleted ;" > bibids echo output bib ids for bibs with no items to file -psql -h db1.sitka.bclibraries.ca -U evergreen -A -t -c 'select distinct record from cotr.non_ebsco_ebibs order by record' > bibids_noitems +psql -h db1.sitka.bclibraries.ca -U evergreen -A -t -c "select distinct record from asset.call_number c where deleted is false and owning_lib in (select distinct id from actor.org_unit_descendants(39)) and label = '##URI##' and not exists (select * from metabib.full_rec where tag = '856' and subfield = 'u' and value like '%ebsco%' and record = c.record) and not exists (select * from asset.call_number cn , asset.copy co where cn.deleted is false and owning_lib in (select distinct id from actor.org_unit_descendants(39)) and cn.id = co.call_number and co.deleted is false and circ_lib in (select distinct id from actor.org_unit_descendants(39)) and c.record = cn.record );" > bibids_noitems echo outputting MARC file for bibs with no items -cat bibids_noitems | ./marc_export_custom_branches --config /srv/openils/conf/opensrf_core.xml --output-file cotr_noitems.mrc --timeout 300 --force901 --encoding UTF-8 --location SITKA --collapse_to_depth 2 &> cotr_noitems_mrc.log +cat bibids_noitems | ./marc_export_custom --config /srv/openils/conf/opensrf_core.xml --output-file cotr_noitems.mrc --timeout 300 --force901 --encoding UTF-8 --location SITKA --collapse_to_depth 2 &> cotr_noitems_mrc.log echo outputting MARC file for regular bibs ... -cat bibids | ./marc_export_custom_branches --config /srv/openils/conf/opensrf_core.xml --output-file cotr.mrc --timeout 300 --force901 --encoding UTF-8 --items --location SITKA --collapse_to_depth 2 --onlyholdings -branch BCREK-CRA,BCREK-CRE,BCREK-FER,BCREK-GOL,BCREK-INV,BCREK-KIM,BCREK-GCR --exclusion_ini cotr_ebsco.ini &> cotr_mrc.log +cat bibids | ./marc_export_custom --config /srv/openils/conf/opensrf_core.xml --output-file cotr.mrc --timeout 300 --force901 --encoding UTF-8 --items --location BCREK --collapse_to_depth 2 --onlyholdings --exclusion_ini cotr_ebsco.ini --field-852-4b-type circ &> cotr_mrc.log echo add cotr.mrc + cotr_noitems.mrc together to cotr_total.mrc cat cotr.mrc cotr_noitems.mrc > cotr_total.mrc