Adds a new -n flag to sftp-client-agent.sh so the agent can be used to
process files with >500 new accounts instead of having to process
manually with generate-patrons-from-csv.pl
Signed-off-by: Bill Erickson <berickxx@gmail.com>
# -------------------------------------------------------------------------
SUCCESS=0
+FORCE_NEW="";
SERVER=prod-depot.eg.kcls.org;
USER=sftpagent;
LIST_PENDING="";
-f Fetch pending files
+ -n Force load using --force-new
+
-b Database server
-a Archive files
trap on_exit EXIT;
-while getopts "s:u:d:b:plfah" opt; do
+while getopts "s:u:d:b:plfanh" opt; do
case $opt in
s) SERVER="$OPTARG";;
u) USER="$OPTARG";;
f) FETCH_PENDING="YES";;
a) ARCHIVE="YES";;
d) DISTRICT_CODE="$OPTARG";;
+ n) FORCE_NEW="--force-new";;
h) usage;
esac
done;
announce "Processing file $LOCAL_FILE"
INFO=$(perl ./generate-patrons-from-csv.pl \
- --log-stdout $TEACHER_FLAG $COLLEGE_FLAG \
+ --log-stdout $TEACHER_FLAG $COLLEGE_FLAG $FORCE_NEW \
--db-host $DB_HOST \
--district-code $code \
--commit-mode each \