Stuff about Linux and Open Source Software

Friday, October 7, 2011

Tomcat: check if process is running

Put this in a cronjob and check every 5 min:

#!/bin/sh

if [ `ps x | grep "java.*" | grep -v grep | grep -vi screen | wc -l` = "0" ]
then
cd /root/my_app
./start > /dev/null &
fi

Posted by dejan at 9:35 AM
Labels: bash, cronjob, tomcat
Older Post Home

About Me

dejan
Toronto, Canada
Expanding my knowledge about Linux and Open Source software wherever I can. Resume
View my complete profile

Blog Archive

  • ▼  2011 (7)
    • ▼  October (1)
      • Tomcat: check if process is running
    • ►  September (1)
      • Run Linux in RAM
    • ►  July (1)
      • Install VMware tools on Linux
    • ►  June (1)
      • sha2 encryption in ruby
    • ►  May (2)
      • Web Developer Tools
      • Create Rails project with any version
    • ►  February (1)
      • MySql dump with Cronjob
  • ►  2010 (3)
    • ►  September (1)
      • Sym Link to multiple CIFS mounts
    • ►  July (2)
      • Quick Image resize
      • data integrity check from CSV
  • ►  2008 (1)
    • ►  May (1)
      • How to setup local Yum repository in Fedora 8
  • ►  2007 (9)
    • ►  November (1)
      • Beware of GParted
    • ►  October (2)
      • Ontario Linux Fest
      • UbuntuZilla
    • ►  September (1)
      • MediaWiki+Ldap
    • ►  August (1)
      • Chat program in C
    • ►  July (3)
      • Sort Digital Photos
      • Building Firefox
      • Compiz fusion - compositing window manager
    • ►  June (1)
      • hello
Simple template. Powered by Blogger.