| 1 | echo output bib ids for regular bibs to file |
| 2 | 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 |
| 3 | |
| 4 | echo output bib ids for bibs with no items to file |
| 5 | 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 |
| 6 | |
| 7 | echo outputting MARC file for bibs with no items |
| 8 | 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 |
| 9 | |
| 10 | echo outputting MARC file for regular bibs ... |
| 11 | 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 |
| 12 | |
| 13 | echo add cotr.mrc + cotr_noitems.mrc together to cotr_total.mrc |
| 14 | cat cotr.mrc cotr_noitems.mrc > cotr_total.mrc |
| 15 | |