Skip to content

Instantly share code, notes, and snippets.

@dadoonet

dadoonet/restart.sh

Created Nov 5, 2012
Embed
What would you like to do?
Restart Twitter River Node on error
#!/bin/bash
file=/usr/local/elasticsearch/elasticsearch-0.19.8/logs/es-twitter.log
if grep -q "TwitterException" $file
then
echo `date +'%Y-%m-%d %H:%M:%S'` ": Restarting ES" >> /home/ec2-user/es.log
/etc/rc.d/init.d/elasticsearch stop
rm $file
/etc/rc.d/init.d/elasticsearch start
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment