[go: up one dir, main page]

Menu

[912642]: / update.sh  Maximize  Restore  History

Download this file

24 lines (20 with data), 694 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
export LANG=en_US.UTF-8 # need for dbf module's locale detection
DIR=`dirname $0`
# files exist
if [[ -s $DIR/family.dbf && -s $DIR/member.dbf ]]
then
source $DIR/../python_virtualenv/bin/activate
echo `date` - running the logos2web update >> $DIR/update.log
python $DIR/update.py "$@"
echo `date` - deleting dbf files >> $DIR/update.log
rm $DIR/*.dbf
# log is older than 3 days
elif [[ `find $DIR/update.log -mtime +3` ]]
then
msg="`date` - No database files processed since `stat -c '%y' $DIR/update.log`"
# for cron output -> mail
echo $msg
# to update the log, so this doesn't trigger again for a while
echo $msg >> $DIR/update.log
fi