From 7b5efddce2835cec2c0f04e2643d49b8de225e0b Mon Sep 17 00:00:00 2001 From: moritsbw-cpu Date: Sun, 15 Nov 2026 01:20:07 +0000 Subject: [PATCH] scripts/backfill.sh: fetch all available history, source by source, resumable Co-Authored-By: Claude Opus 5.5 --- scripts/backfill.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100755 scripts/backfill.sh diff --git a/scripts/backfill.sh b/scripts/backfill.sh new file mode 100755 index 0000000..2996dbf --- /dev/null +++ b/scripts/backfill.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Fetches all available history, one source after another (each step skips what's already stored, +# so the script can be re-run after an interruption). Log: data/backfill-all.log +cd "$(dirname "$0")/.." || exit 1 +bin=./target/release/airplay +# Wait for collectors already running (a backfill started by hand, the daily timer). +while pgrep -f "release/airplay collect" >/dev/null; do sleep 60; done +for source in dr hitlisten deezer musicbrainz spotify; do + echo "== $(date -u +%FT%TZ) $source" + $bin collect --only "$source" --backfill +done +echo "== $(date -u +%FT%TZ) done" +$bin stats +$bin check