Switch available items with circulate flag = false to Lib Use Only status.
Bradley Bonner
bbonner@kcls.org
# Update copy status for BC
#0 22 * * * . ~/.bashrc && cd $SCRIPT_DIR/bc_missing/ && ./bc_missing.sh
+# Update copy status - make items lib use only
+#0 3 * * * . ~/.bashrc && cd $SCRIPT_DIR/make_items_lib_use_only/ && ./make_lib_use_only.sh
+
# Update Envisionware patron access
#30 0 * * * . ~/.bashrc && cd $SCRIPT_DIR/envware_access/ && ./envware_access.sh
--- /dev/null
+#!/bin/bash
+
+psql -U evergreen < make_lib_use_only.sql > log.make_lib_use_only
+
+cat log.make_lib_use_only | mailx -s "Items made Lib Use Only" bbonner@kcls.org
+
--- /dev/null
+BEGIN;
+
+SET SESSION STATEMENT_TIMEOUT TO 0;
+
+SELECT
+asset.copy.id, asset.copy.barcode
+FROM
+asset.copy
+WHERE
+deleted = 'f' and circulate = 'f' and status = 0 and call_number != -1;
+
+UPDATE asset.copy SET status = '102' where asset.copy.id IN (
+SELECT
+asset.copy.id
+FROM
+asset.copy
+WHERE
+deleted = 'f' and circulate = 'f' and status = 0 and call_number != -1
+);
+COMMIT;