#!/bin/sh
# This should be called from cron as user eprints.
# It processes all outstanding daily/weekly/monthly alerts depending on the value
# of the argument.

find /opt/eprints3/archives -mindepth 1 -maxdepth 1 -type d -printf "%f $1\n" \
    | xargs --max-args=2 --no-run-if-empty /opt/eprints3/bin/send_alerts --quiet
