#!/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). # (match the process name, not -f: a parent shell whose command line mentions the binary would match forever) while pgrep -x airplay -a | grep -q " collect"; do sleep 60; done for source in dr hitlisten deezer musicbrainz spotify nmf playlists; do echo "== $(date -u +%FT%TZ) $source" $bin collect --only "$source" --backfill done echo "== $(date -u +%FT%TZ) done" $bin stats $bin check