-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa11666
commit 09d5389
Showing
6 changed files
with
44 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ pages/depts/* | |
pages/retry.json | ||
pages/index.html | ||
|
||
mongo-connector.log | ||
oplog.timestamp | ||
*.log | ||
*.timestamp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/bin/bash | ||
timeout 1m python get_all.py | ||
timeout 1m python -u get_all.py | ||
while [ "$(<retry.json)" != "[]" ]; do | ||
echo "Execution timeout, retry ..." | ||
timeout 1m python get_all.py retry | ||
timeout 1m python -u get_all.py retry | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
while read line ; do | ||
echo "[$(date '+%Y-%m-%d %H:%M')] ${line}" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,24 @@ | ||
#!/bin/bash | ||
|
||
echo "Starting mongo-connector" | ||
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager --admin-username ccns --password CCNSccns & | ||
cd $(dirname "$0") | ||
BASEDIR=$(pwd) | ||
LOGDIR=${1:-$BASEDIR/log} | ||
LOGFILE=$LOGDIR/update.log | ||
|
||
echo "Starting mongo-connector" | $BASEDIR/predate.sh >> $LOGFILE | ||
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic2_doc_manager\ | ||
-a ccns -p CCNSccns\ | ||
--logfile $LOGDIR/mongo-connector.log --oplog-ts $LOGDIR/oplog.timestamp & | ||
MCPID=$! | ||
echo "Mongo-connector started. PID=$MCPID" | ||
BASEDIR=$(dirname "$0") | ||
(cd $BASEDIR/pages && ./update_pages.sh && cd ..) | ||
node run | ||
echo "Killing mongo-connector. PID=$MCPID" | ||
kill $MCPID | ||
echo "Success" | ||
echo "Mongo-connector started. PID=$MCPID" | $BASEDIR/predate.sh >> $LOGFILE | ||
|
||
(time bash -c "cd $BASEDIR/pages && ./update_pages.sh | $BASEDIR/predate.sh >> $LOGFILE && cd ..") 2>&1 | $BASEDIR/predate.sh >> $LOGFILE | ||
node run | $BASEDIR/predate.sh >> $LOGFILE | ||
|
||
echo "Killing mongo-connector. PID=$MCPID" | $BASEDIR/predate.sh >> $LOGFILE | ||
kill $MCPID 2>&1 | $BASEDIR/predate.sh >> $LOGFILE | ||
if [ $PIPESTATUS -eq 0 ]; then | ||
echo "All success." | $BASEDIR/predate.sh >> $LOGFILE | ||
else | ||
echo "Kill mongo-connector failed." | $BASEDIR/predate.sh >> $LOGFILE | ||
fi |