Skip to content

Commit

Permalink
Merge #505 from branch '504-addEmailReminderToGetNewBasedump' of http…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Nov 6, 2023
2 parents af736bd + c5b5b28 commit f2adbff
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions checkIfBaseDataShouldBeUpdated.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# mail if basedump is more than a year old
# see https://github.com/hbz/lobid-organisations/issues/504

MAIL_TO=$(cat .secrets/MAIL_TO)
MAIL_FROM=$(cat .secrets/MAIL_FROM)

OLD_BASEDUMP_DATE=$(grep 'transformation.updates.start' conf/application.conf |cut -f2 -d "\"")
OLD_BASEDUMP_DATE_PLUS_ONE_YEAR=$(date '+%C%y%m%d' -d"${OLD_BASEDUMP_DATE}+1 year")
NOW=$(date '+%C%y%m%d')

if [ $NOW -gt $OLD_BASEDUMP_DATE_PLUS_ONE_YEAR ]; then
mail -s "Zeit fuer neuen Pica basedump fuer lobid-organisations" "${MAIL_TO}" -a "From: ${MAIL_FROM}" << EOF
Getriggert und ausgeführt in $(pwd)/checkIfBaseDataShouldBeUpdated.sh :
Es ist Zeit sich von der ZDB einen neuen binary PICA Sigel basedump zu holen.
Siehe https://github.com/hbz/lobid-organisations/issues/504.
EOF
fi


2 changes: 2 additions & 0 deletions restart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ If you want to stop it permanently via cmd, do this first:
$ sudo /etc/ini.d/monit stop
"

bash checkIfBaseDataShouldBeUpdated.sh

if [ ! $# -eq 1 ]; then
echo "$USAGE"
exit 65
Expand Down

0 comments on commit f2adbff

Please sign in to comment.