From 665885d3f5a4476c323f7d1dcce59bc375696c78 Mon Sep 17 00:00:00 2001 From: Dan White Date: Sat, 17 Aug 2024 20:11:31 -0500 Subject: [PATCH] do-updates: fixup venv and verbose script timing --- do-updates.sh | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/do-updates.sh b/do-updates.sh index eb5e13f..379602c 100755 --- a/do-updates.sh +++ b/do-updates.sh @@ -2,6 +2,11 @@ # update SatNOGS observations archive + +function utcdate() { + date -u '+%Y-%m-%d %H:%M:%SZ' +} + cd ~/ed/scheduling-bazaar cd data @@ -10,21 +15,24 @@ cd data #conda activate bazaar # (now) using python virtual environment -. ../.direnv/python-3.10.6/bin/activate +. ../.direnv/python-3.10.12/bin/activate #python -c 'import skyfield; print(skyfield.__version__)' #python -c 'import sgp4; print(sgp4.__version__)' +utcdate echo "*** Fetching database items" ../python-files/get-db.sh +utcdate echo "*** Fetching stations info" ../python-files/get-stations.py stations.json # and update the stations SQLite database for analysis ../python-files/update-stations stations.json stations.db echo +utcdate echo "*** Getting observations" #../python-files/get-observations.py --fetch observations.db #../python-files/get-observations.py --fetch --retry-unknown observations.db @@ -35,12 +43,17 @@ echo "*** Getting observations" # lag by 1 week to let some updates settle down date_end="$(date -u --date='1 week ago' '+%Y-%m-%dT%H:%M')" -../python-files/get-observations.py --fetch --pages 300 --end="$date_end" observations.db demoddata.db +utcdate +../python-files/get-observations.py --fetch --pages 300 --end="$date_end" observations.db demoddata.db || true +# ignore bad exit (throttled API) # what changed? #git diff +utcdate git add db-*.json stations.json + +utcdate git commit -m 'cron update info' exit -- 2.25.1