From fbc554985e474cfcdb0e5ce058159ceeeafba5c7 Mon Sep 17 00:00:00 2001 From: Pascal Christoph Date: Mon, 19 Feb 2024 12:06:53 +0100 Subject: [PATCH] Update every day a whole day as fallback (#372) This redundancy in updating the data should bring more stability in being in sync with upstream data. --- cron.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/cron.sh b/cron.sh index c28890a..ecade74 100644 --- a/cron.sh +++ b/cron.sh @@ -3,11 +3,20 @@ # explicitly without "-e" for it should not exit immediately when failed but write a mail set -uo pipefail # See http://redsymbol.net/articles/unofficial-bash-strict-mode/ # Execute via crontab by hduser@weywot1: -# 00 1 * * * ssh sol@quaoar1 "cd /home/sol/git/lobid-gnd ; bash -x cron.sh >> logs/cron.sh.log 2>&1" +# 00 1 * * * [removed] git/lobid-gnd ; bash -x cron.sh >> logs/cron.sh.log 2>&1" +# 50 05 * * * [removed] git/lobid-gnd ; bash -x cron.sh 1day >> logs/cron.sh.log 2>&1" + IFS=$'\n\t' RECIPIENT=lobid-admin -sbt -mem 4000 "runMain apps.ConvertUpdates $(tail -n1 GND-lastSuccessfulUpdate.txt)" +START_UPDATE=$(tail -n1 GND-lastSuccessfulUpdate.txt) +unset http_proxy + +if [ -n "${1-}" ] && [ "$1" = "1day" ]; then + START_UPDATE=$(date --date='1 day ago' +%Y-%m-%dT%H:%M:%SZ) +fi + +sbt -mem 4000 "runMain apps.ConvertUpdates ${START_UPDATE}" if [ -s GND-updates.jsonl ]; then sbt -Dindex.prod.name=gnd-test "runMain apps.Index updates" @@ -19,3 +28,4 @@ if [ -s GND-updates.jsonl ]; then bash ./checkCompactedProperties.sh gnd fi fi +