Created
January 24, 2012 12:15
-
-
Save kiyoka/1669942 to your computer and use it in GitHub Desktop.
hourly restarter for Kahua workers
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
#!/bin/bash | |
# Please specify OT_SITE variable in config.sh | |
source config.sh | |
restart_workers() { | |
# ids of kahua workers | |
ids=`kahua-admin -S=$OT_SITE ls | awk ' $1 ~ /[0-9]+/ { print $1}'` | |
echo ids: $ids | |
# restart workers | |
for id in $ids ; | |
do | |
cmd="kahua-admin -S=$OT_SITE restart $id" | |
echo $cmd | |
$cmd | |
cmd="sleep 10" | |
echo $cmd | |
$cmd | |
done | |
} | |
while : | |
do | |
cmd=restart_workers | |
echo $cmd | |
$cmd | |
cmd="sleep 3600" | |
echo $cmd | |
$cmd | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment