--- /dev/null
+#!/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
+