Compare commits
2 Commits
8507cbd189
...
ed7c2b8b29
| Author | SHA1 | Date | |
|---|---|---|---|
| ed7c2b8b29 | |||
| 3fcd6af3a9 |
@@ -7,9 +7,9 @@
|
|||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
echo "$DIR/$PROG"
|
echo "$DIR/$PROG"
|
||||||
cd $DIR
|
|
||||||
|
|
||||||
echo "*** Running cronjob @ `date` ***"
|
echo "*** Running cronjob @ `date` ***"
|
||||||
|
cd $DIR
|
||||||
|
|
||||||
# Pull any updates, and if the project is already up to date, exit successfully.
|
# Pull any updates, and if the project is already up to date, exit successfully.
|
||||||
git pull | grep -v "up to date"
|
git pull | grep -v "up to date"
|
||||||
|
|||||||
14
run.sh
14
run.sh
@@ -4,8 +4,9 @@
|
|||||||
|
|
||||||
## Setup ##
|
## Setup ##
|
||||||
|
|
||||||
DIR=`dirname $0`
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG=`basename $0`
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
|
echo "$DIR/$PROG"
|
||||||
|
|
||||||
## Functions ##
|
## Functions ##
|
||||||
|
|
||||||
@@ -120,11 +121,20 @@ find files/photos/ -name "*".html -print -delete
|
|||||||
|
|
||||||
## Main ##
|
## Main ##
|
||||||
|
|
||||||
|
log "Start repo updater"
|
||||||
|
while true; do
|
||||||
|
$DIR/cronjob.sh
|
||||||
|
sleep 30
|
||||||
|
done &
|
||||||
|
|
||||||
log "Start website API."
|
log "Start website API."
|
||||||
node ./main.js $ports
|
node ./main.js $ports
|
||||||
status=$?
|
status=$?
|
||||||
|
|
||||||
## Finish ##
|
## Finish ##
|
||||||
|
|
||||||
|
log "Kill spawned processes."
|
||||||
|
pkill -P $$
|
||||||
|
|
||||||
log "Exiting with status '$status'."
|
log "Exiting with status '$status'."
|
||||||
exit $status
|
exit $status
|
||||||
|
|||||||
Reference in New Issue
Block a user