# update SatNOGS observations archive
+
+function utcdate() {
+ date -u '+%Y-%m-%d %H:%M:%SZ'
+}
+
cd ~/ed/scheduling-bazaar
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
# 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