This bash script can be used to extract data from the Sierra ILS PostgreSQL database and transfer it to Shoutbomb for phone notifications.
The script handles holds, overdues, renewals, and patron notice preference (SMS text or voice call). The notice type is determined based on the value of the patron's PCODE1 field in Sierra, but text_patrons.sql
and voice_patrons.sql
could be modified to look at different fields.
The script depends on psql to query PostgreSQL and lftp for FTPS transfers.
You will also need a Sierra account with SQL privileges.
-
Create a .pgpass password file containing your Sierra database server information and credentials. Example:
sierra-db.helenplum.org:1032:iii:shoutbomb:PASSWORD
-
Create an lftp bookmark names ShoutbombFTP containing your FPT credentials ftp.shoutbomb.com:
lftp -c "bookmark add ShoutbombFTP ftps://USERNAME:PASSWORD@ftp.shoutbomb.com"
-
Schedule a cron job to run
shoutbomb.sh
at least once per day.