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