* Needs to be run on an server running Evergreen.
* It should be run as the *opensrf* user.
* You will need to know your Evergreen database administrator connection information.
+* Summon must be configured to accept a flat file of IDs for deleted
+ records. Contact your Serial Solutions technical support for details.
+
Installation
------------
. Edit your SQL files _deleted_bibs.sql_ and _updated_bibs.sql_ as needed to limit the bib records to be exported into the MARC file.
. Edit the ftp transfer script: _/home/opensrf/summon/ftp_transfer.sh_ and set the ftp username and password provided by Serials Solution.
. Run _bib_export_deletes_and_updates.sh_ as *opensrf*.
-. New MARC files should be located in /home/opensrf/summon/deletes/deletes and /home/opensrf/summon/deletes/updates. These should
- represent the deletes and updates made to bib records on the day you ran the script. The file name should include today's date.
+. A flat file of deleted records will be located in_/home/opensrf/summon/deletes/deletes_
+. A MARC file should be located in /home/opensrf/summon/deletes/updates. These should
+ represent the updates made to bib records on the day you ran the script. The file name should include today's date.
. Check the MARC files to ensure format looks good.
. Files should have also been ftp'd automatically to the Summon server. You might want to contact Serials Solutions to ensure it looks good on their end.
. If you encounter any issues, check the log files in /home/opensrf/summon/log to see where problems occurred.
echo "Bib ids selected for export:" > /home/opensrf/summon/log/deleted_bibs.log."$(date "+%Y%m%d")"
cat /home/opensrf/summon/deleted_bibs.ids >> /home/opensrf/summon/log/deleted_bibs.log."$(date "+%Y%m%d")"
-#sql Remove empty line at end of SQL output file.
-sed '/^$/d' /home/opensrf/summon/deleted_bibs.ids > /home/opensrf/summon/tt
-mv /home/opensrf/summon/tt /home/opensrf/summon/deleted_bibs.ids
+#sql Remove extra lines at end of SQL output file.
+sed '/^$/d' /home/opensrf/summon/deleted_bibs.ids | sed '/id/d' | sed '/---/d' | sed '/rows/d' | sed 's/ //g' > /home/opensrf/summon/tt
+mv /home/opensrf/summon/tt /home/opensrf/summon/deletes/deleted_bibs-$(date +"%Y%m%d").ids
+
+
#pass the bib ids to the marc_export program to write marc records to deleted_bibs.mrc
# and write out output summary to deleted_bibs.log
cat /home/opensrf/summon/updated_bibs.ids >> /home/opensrf/summon/log/updated_bibs.log."$(date +"%Y%m%d")"
#sql Remove empty line at end of SQL output file.
-sed '/^$/d' /home/opensrf/summon/updated_bibs.ids > /home/opensrf/summon/tt2
+
+sed '/^$/d' /home/opensrf/summon/updated_bibs.ids | sed '/id/d' | sed '/---/d' | sed '/rows/d' | sed 's/ //g' > /home/opensrf/summon/tt2
mv /home/opensrf/summon/tt2 /home/opensrf/summon/updated_bibs.ids
#pass the bib ids to the marc_export program to write marc records to deleted_bibs.mrc
# call ftp script to ftp the MARC files onto the summon server.
echo "FTP bibs:" >> /home/opensrf/summon/log/deleted_bibs.log."$(date +"%Y%m%d")"
-/home/opensrf/summon/ftp_transfer.sh /home/opensrf/summon/deletes/deletes-$(date +"%Y%m%d").marc deletes-$(date +"%Y-%m-%d-%H-%M-%S").marc deletes
+/home/opensrf/summon/ftp_transfer.sh /home/opensrf/summon/deletes/deleted_bibs-$(date +"%Y%m%d").ids deletes-$(date +"%Y-%m-%d-%H-%M-%S").deletes deletes
+
echo "FTP bibs:" >> /home/opensrf/summon/log/updated_bibs.log."$(date +"%Y%m%d")"
/home/opensrf/summon/ftp_transfer.sh /home/opensrf/summon/updates/updates-$(date +"%Y%m%d").marc updates-$(date +"%Y-%m-%d-%H-%M-%S").marc updates