forked from kamba4/sunders
Adds health checks to web and data_handler container; restarting on failure #24
4 changed files with 6 additions and 6 deletions
refactor: Increases verbosity of data_handler
commit
58f048adba
|
|
@ -5,4 +5,4 @@ COPY ./data_init/*.sql /opt/init/init.sql
|
||||||
|
|
||||||
ENTRYPOINT ["/opt/entrypoint.sh"]
|
ENTRYPOINT ["/opt/entrypoint.sh"]
|
||||||
|
|
||||||
CMD ["/usr/sbin/dcrond", "-f" ]
|
CMD ["/bin/sh", "-c", "/usr/sbin/dcrond -f -d 5 > /var/log/dcrond.log 2>&1"]
|
||||||
|
|
@ -8,7 +8,7 @@ set -e
|
||||||
|
|
||||||
cat<<EOF | dcrontab -
|
cat<<EOF | dcrontab -
|
||||||
# min hour day month weekday command
|
# min hour day month weekday command
|
||||||
5 * * * * sh /opt/update_camera.sh
|
*/15 * * * * sh /opt/update_camera.sh >> /var/log/update_camera_$(date +\%Y\%m\%d\%H\%M\%S).log 2>&1
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
####################################################################################################
|
####################################################################################################
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ do
|
||||||
rm "change_file.osc.gz"
|
rm "change_file.osc.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo `date "+%d/%m/%Y %H:%M"`" - Start processing sequence number $curSeqNum" > "$logFileName"
|
echo `date "+%d/%m/%Y %H:%M"`" - Start processing sequence number $curSeqNum of $newSeqNum" > "$logFileName"
|
||||||
|
|
||||||
targetDirName=`echo "000000000$curSeqNum" | sed 's#.*\(...\)\(...\)\(...\)$#\1/\2/\3.osc.gz#'`
|
targetDirName=`echo "000000000$curSeqNum" | sed 's#.*\(...\)\(...\)\(...\)$#\1/\2/\3.osc.gz#'`
|
||||||
targetDirName="$REPLICATE_URL/$targetDirName"
|
targetDirName="$REPLICATE_URL/$targetDirName"
|
||||||
|
|
@ -87,7 +87,7 @@ do
|
||||||
targetDirName=`echo "$targetDirName" | sed 's/.osc.gz$/.state.txt/'`
|
targetDirName=`echo "$targetDirName" | sed 's/.osc.gz$/.state.txt/'`
|
||||||
|
|
||||||
curl -L "$targetDirName" -o lastState.txt 2>&1 | tee -a $logFileName
|
curl -L "$targetDirName" -o lastState.txt 2>&1 | tee -a $logFileName
|
||||||
echo `date "+%d/%m/%Y %H:%M"`" - Finish processing sequence number $curSeqNum" | tee -a "$logFileName"
|
echo `date "+%d/%m/%Y %H:%M"`" - Finish processing sequence number $curSeqNum of $newSeqNum" | tee -a "$logFileName"
|
||||||
done
|
done
|
||||||
|
|
||||||
rm "/var/lock/update_camera"
|
rm "/var/lock/update_camera"
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ do
|
||||||
rm "change_file.osc.gz"
|
rm "change_file.osc.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo `date "+%d/%m/%Y %H:%M"`" - Start processing sequence number $curSeqNum" > "$logFileName"
|
echo `date "+%d/%m/%Y %H:%M"`" - Start processing sequence number $curSeqNum of $newSeqNum" > "$logFileName"
|
||||||
|
|
||||||
targetDirName=`echo "000000000$curSeqNum" | sed 's#.*\(...\)\(...\)\(...\)$#\1/\2/\3.osc.gz#'`
|
targetDirName=`echo "000000000$curSeqNum" | sed 's#.*\(...\)\(...\)\(...\)$#\1/\2/\3.osc.gz#'`
|
||||||
targetDirName="$REPLICATE_URL/$targetDirName"
|
targetDirName="$REPLICATE_URL/$targetDirName"
|
||||||
|
|
@ -84,7 +84,7 @@ do
|
||||||
targetDirName=`echo "$targetDirName" | sed 's/.osc.gz$/.state.txt/'`
|
targetDirName=`echo "$targetDirName" | sed 's/.osc.gz$/.state.txt/'`
|
||||||
wget -nv "$targetDirName" -O lastState.txt 2>&1 | tee -a $logFileName
|
wget -nv "$targetDirName" -O lastState.txt 2>&1 | tee -a $logFileName
|
||||||
|
|
||||||
echo `date "+%d/%m/%Y %H:%M"`" - Finish processing sequence number $curSeqNum" | tee -a "$logFileName"
|
echo `date "+%d/%m/%Y %H:%M"`" - Finish processing sequence number $curSeqNum of $newSeqNum" | tee -a "$logFileName"
|
||||||
done
|
done
|
||||||
|
|
||||||
rm "/var/lock/update_camera"
|
rm "/var/lock/update_camera"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue