Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions iiifify.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# When there are files named *-initiated in the provided directory,
# run the processing script for the targeted files.
# Process the oldest -initiated file in the STATUS_FILES_DIR directory
# Additional files will be processed next time cron calls this script

# CONFIGURATION:
# - set values in `iiifify.ini`
Expand All @@ -10,12 +10,10 @@
# USAGE:
# /bin/bash /path/to/this/script.sh

# set the nullglob in case there are no `*-initiated` files
shopt -s nullglob

# expecting an absolute path as an argument
for FILE in "$(source "$(dirname "$0")"/iiifify.ini && echo "$STATUS_FILES_DIR")"/*-initiated; do
barcode=$(basename "$FILE" | cut -d '-' -f 1)
status_files_dir=$(source "$(dirname "$0")"/iiifify.ini && echo "$STATUS_FILES_DIR")
file="$(ls -tr $status_files_dir/*-initiated 2> /dev/null | head -1)"
if [ -n "$file" ]; then
barcode=$(basename "$file" | cut -d '-' -f 1)
python=$(source "$(dirname "$0")"/iiifify.ini && echo "$PYTHON")
$python "$(dirname "$0")"/dibsiiif.py "$barcode"
done
fi