POE Paste with lovely alien head...

No paste!

from "JBoyer" at 64.57.241.14
Basic Novelist script for jvwoolf

format options below
#!/bin/bash

DATE=`date +%Y%m%d`
FILE="/srv/novelist/novelist""$DATE".tsv
ZIPFILE="$FILE".zip
FTPFILE="`basename $ZIPFILE`"
FTPUSER="USER"
FTPPASS="PASSWD"
FTPSITE="ftp.epnet.com"
FTPDIR="DIRECTORY"
LOCALDIR="/srv/novelist"
EMAILFROM="DoNotReply@DOMAIN"
EMAILTO="ADMIN@YOURDOMAIN.ORG,NoveListSelectSupport@ebscohost.com"
EMAILSUBJECT="ISBN 3M Update - SUBJ FROM NOVELIST SUPPORT"

SQLSTR="select force_to_isbn13(d.value) as isbn, b.barcode as itemid, btrim(regexp_replace(c.label, '[\s]+',' ','g')) as bibrecordcallno,c.record as bibrecordid, a.title as title
from reporter.super_simple_record a, asset.copy b, asset.call_number c, metabib.real_full_rec d
where b.deleted = 'f' and b.status not in (select id from config.copy_status where name in ('Missing','Discard/Weed','Damaged','Lost','Long Overdue (Legacy)','Long Overdue','Lost and Paid','Lost (Legacy)')) and b.call_number != -1 and b.call_number = c.id and c.record = a.id and c.record = d.record and d.tag = '020' and d.subfield in ('a','z') order by bibrecordcallno, title"

# Remove any previous extract data
rm -f /srv/novelist/novelist*.tsv

date
echo Fetching Holdings for Novelist...
psql -U DBUSER -h DBHOST-F $'\t' --pset footer=off --no-align  -c "$SQLSTR"   > $FILE
date
echo Done.


# Remove any previous extract data
rm -f /srv/novelist/novelist*.zip
echo Zipping to conserve space...
zip $ZIPFILE $FILE
date
echo Sending to Novelist FTP site...
ftp -v -n $FTPSITE <<END_SCRIPT
passive
quote USER $FTPUSER
quote PASS $FTPPASS
binary
cd $FTPDIR
lcd $LOCALDIR
put $FTPFILE
quit
END_SCRIPT

echo "Done."
date

# Send email notification to Novelist folks so they know to process our ftp file...
echo "EMAIL BODY" | ./send-email.pl --from "$EMAILFROM" --to "$EMAILTO" --subject "$EMAILSUBJECT"



# Remove the current extracted file to conserve space
rm -f $FILE





perl stuff: (might be helpful for others but not perfect)



Valid HTML 4.01!

Pastebot is powered by POE.