forked from vufind-org/vufind
-
Notifications
You must be signed in to change notification settings - Fork 1
/
run_daily_updates.sh
executable file
·56 lines (43 loc) · 1.6 KB
/
run_daily_updates.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/usr/bin/env bash
if [ -z "$VUFIND_HOME" ]
then
VUFIND_HOME="/usr/local/vufind"
fi
if [ -z "$MACHINE_NAME" ]
then
MACHINE_NAME="DevKoha"
fi
if [ -z "$KOHA_BASE_URL" ]
then
KOHA_BASE_URL="https://koha.dainst.de/download/exports"
fi
if [ -z "$VUFIND_LOCAL_DIR" ]
then
VUFIND_LOCAL_DIR=/usr/local/vufind/local
fi
MARC_UPDATE_LOG="$VUFIND_HOME/local/harvest/log/`date +\%Y-\%m-\%d`.log"
"$VUFIND_HOME/local/harvest/update.sh" $(date +\%Y-\%m-\%d -d '1 days ago') &> "$MARC_UPDATE_LOG"
if [ -z "$MAILTO" ]
then
else
RECIPIENT="[email protected]"
fi
if [[ -z ${MACHINE_NAME:+x} ]] ;
then
MACHINE_NAME="Unnamed machine"
fi
#if egrep --ignore-case 'error|except' "$MARC_UPDATE_LOG" | egrep -v -q 'Completed without errors' ;
#then
# cat "$MARC_UPDATE_LOG" | mail -s "VuFind ($MACHINE_NAME) marc update -- ERROR" -a "From: [email protected]" "$RECIPIENT"
#else
# cat "$MARC_UPDATE_LOG" | mail -s "VuFind ($MACHINE_NAME) marc update -- SUCCESS" -a "From: [email protected]" "$RECIPIENT"
#fi
#PUBLICATIONS_UPDATE_LOG="$VUFIND_HOME/local/iDAI.world/log/publications_`date +\%Y-\%m-\%d`.log"
#"$VUFIND_HOME/local/iDAI.world/fetchMappings.sh" &> "$PUBLICATIONS_UPDATE_LOG"
#if grep --ignore-case -q error "$PUBLICATIONS_UPDATE_LOG";
#then
# cat "$PUBLICATIONS_UPDATE_LOG" | mail -s "VuFind ($MACHINE_NAME) publications mapping update -- ERROR" -a "From: [email protected]" "$RECIPIENT"
#else
# cat "$PUBLICATIONS_UPDATE_LOG" | mail -s "VuFind ($MACHINE_NAME) publications mapping update -- SUCCESS" -a "From: [email protected]" "$RECIPIENT"
#fi