fuzzyworld

fuzzyworld-tools / files / server / jobs / issues-ingest.sh

issues-ingest.sh

516 B · history · blame

1#!/bin/bash
2# Hourly: turn new mail in the bugs mailbox (IMAP, or ~/Maildir/.bugs) into issues (see server/issues.py).
3# Quiet unless something happened or failed.
4set -euo pipefail
5mkdir -p "$HOME/fw/state/locks"
6exec 9>"$HOME/fw/state/locks/job-issues-ingest.lock"
7flock -n 9 || exit 0
8out=$(python3 "$HOME/fw/tools/server/issues.py" ingest 2>&1) || { echo "== $(date -u '+%F %T UTC') issues ingest failed"; echo "$out"; exit 1; }
9[ -z "$out" ] || { echo "== $(date -u '+%F %T UTC') issues ingest"; echo "$out"; }