Skip to content

Commit

Permalink
Use variables for index names
Browse files Browse the repository at this point in the history
- update hourly cron call
- remove superflous line
  • Loading branch information
dr0i committed Feb 20, 2024
1 parent 318c556 commit 12bc9c1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions cron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
# 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 * * * [removed] git/lobid-gnd ; bash -x cron.sh >> logs/cron.sh.log 2>&1"
# 40 * * * * [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
START_UPDATE=$(tail -n1 GND-lastSuccessfulUpdate.txt)
TEST_INDEX=gnd-test
INDEX=gnd
unset http_proxy

if [ -n "${1-}" ] && [ "$1" = "1day" ]; then
Expand All @@ -19,13 +20,13 @@ 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"
bash ./checkCompactedProperties.sh gnd-test
sbt -Dindex.prod.name=$TEST_INDEX "runMain apps.Index updates"
bash ./checkCompactedProperties.sh $TEST_INDEX

# if check ok, index to productive instance:
if [ $? -eq 0 ]; then
sbt -Dindex.prod.name=gnd "runMain apps.Index updates"
bash ./checkCompactedProperties.sh gnd
sbt -Dindex.prod.name=$INDEX "runMain apps.Index updates"
bash ./checkCompactedProperties.sh $INDEX
fi
fi

0 comments on commit 12bc9c1

Please sign in to comment.