Skip to content

Instantly share code, notes, and snippets.

@kngeno
Created November 10, 2019 17:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kngeno/fea1f2c5e6a45fe4609c082e21a1b5de to your computer and use it in GitHub Desktop.
Save kngeno/fea1f2c5e6a45fe4609c082e21a1b5de to your computer and use it in GitHub Desktop.
A bashscript to restart tomcat8 using a cronjob
#!/usr/bin/env bash
URL='https://<url or domain>/geoserver/<workspace>/ows?service=WFS&version=1.0.0&request=GetFeature&typeName=geonode:ken_adm&maxFeatures=50&outp$
# only output error messages
curl -s -S -f $URL > /dev/null
if [ $? -ne 0 ]; then
date
echo Restarting Tomcat8 service
sudo /etc/init.d/tomcat8 restart
echo KiWASH GeoServer Instance is restarting! | mutt -s "KiWASH GeoServer Instance" kngeno.kevin@gmail.com
echo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment