adding script for EGCR security gates
authorChris Sharp <csharp@georgialibraries.org>
Mon, 19 Dec 2011 17:20:31 +0000 (12:20 -0500)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 19 Dec 2011 17:23:18 +0000 (12:23 -0500)
Open-ILS/examples/pines-examples/reports-server/currently-out.sh [new file with mode: 0644]

diff --git a/Open-ILS/examples/pines-examples/reports-server/currently-out.sh b/Open-ILS/examples/pines-examples/reports-server/currently-out.sh
new file mode 100644 (file)
index 0000000..2607fc4
--- /dev/null
@@ -0,0 +1,32 @@
+#!/bin/sh
+#
+# This is a script to create a list of barcodes for currently checked out items
+# for a library system where one OU has an RFID product that is incompatible with
+# all the other branches' setups.  The barcodes file is created, then copied to an 
+# intermediary relay server that FTPs the file to the remote server.
+#
+
+
+        DATE=`date +%F`;
+        LFILE=currently-out.ECGR.$DATE
+        RFILE=syncdata1.txt
+        RELAYER=216.154.195.229 #content01
+       REMOTE_HOST=0.0.0.0     
+
+        echo `date`: Creating $LFILE...
+        PGUSER=postgres /usr/bin/psql sparkle -tc "SELECT cp.barcode FROM action.circulation circ JOIN asset.copy cp ON (cp.id = circ.target_copy) JOIN actor.org_unit ou ON (ou.id = circ.circ_lib) WHERE ou.shortname in ('ECGR-CCO','ECGR-EUCHE','ECGR-HARLM') AND circ.checkin_time IS NULL;" > $LFILE
+
+
+        echo `date`: $LFILE is `ls -lh $LFILE | cut -d' ' -f5`...
+        echo `date`: Copying $LFILE to relayer as $RFILE... 
+        scp $LFILE rfidrelay@$RELAYER:~/$RFILE
+
+#       echo `date`: not uploading file 
+        echo `date`: Uploading $RFILE from relayer to library..
+        ssh rfidrelay@$RELAYER "ncftpput -a -E -u rfidftp -p ilsFTP $REMOTE_HOST / $RFILE"
+
+        echo `date`: Removing $RFILE from relayer...
+        ssh rfidrelay@$RELAYER "rm -f $RFILE"
+
+        echo `date`: Done
+