Skip to content

Instantly share code, notes, and snippets.

@dadoonet
Created November 5, 2012 21:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dadoonet/4020312 to your computer and use it in GitHub Desktop.
Save dadoonet/4020312 to your computer and use it in GitHub Desktop.
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