do-updates: fixup venv and verbose script timing master s3/master
authorDan White <dan@whiteaudio.com>
Sun, 18 Aug 2024 01:11:31 +0000 (20:11 -0500)
committerDan White <dan@whiteaudio.com>
Sun, 18 Aug 2024 01:11:31 +0000 (20:11 -0500)
do-updates.sh

index eb5e13f118ae3c241de26ce35008a9a7e3c9f274..379602ceff58fdfb0c581ddf57598a07bffdd0de 100755 (executable)
@@ -2,6 +2,11 @@
 
 # update SatNOGS observations archive
 
 
 # update SatNOGS observations archive
 
+
+function utcdate() {
+    date -u '+%Y-%m-%d %H:%M:%SZ'
+}
+
 cd ~/ed/scheduling-bazaar
 cd data
 
 cd ~/ed/scheduling-bazaar
 cd data
 
@@ -10,21 +15,24 @@ cd data
 #conda activate bazaar
 
 # (now) using python virtual environment
 #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__)'
 
 
 
 #python -c 'import skyfield; print(skyfield.__version__)'
 #python -c 'import sgp4; print(sgp4.__version__)'
 
 
+utcdate
 echo "*** Fetching database items"
 ../python-files/get-db.sh
 
 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
 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
 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')"
 
 # 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
 
 
 # what changed?
 #git diff
 
+utcdate
 git add db-*.json stations.json
 git add db-*.json stations.json
+
+utcdate
 git commit -m 'cron update info'
 
 exit
 git commit -m 'cron update info'
 
 exit