• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

autorestart tomcat

 
gana rajan
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need a script for tomcat restart at specified time by a user which able to run in any platform. it should be OS independent.
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not going to happen. The reason is simple - there is no uniform way of starting and stopping Tomcat, no uniform syntax for the scripts to do this and no uniform way of scheduling jobs.

And you should know that even if such a script would be possible, we are NotACodeMill and wouldn't just provide it like that.
 
gana rajan
Greenhorn
Posts: 16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i've create batch file which run on windows and sh file which run on linux. i did not ask you to provide the full coding. but, ask you to show me the way on how to do it.
 
Tim Moores
Bartender
Pie
Posts: 2488
4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This could involve a cron job that runs every 5 minutes and checks whether the Tomcat process is still alive, and restarts it if it isn't.

Edit: just saw that the title is actually somewhat different than the question behind it. My answer would thus be simplified to: This could involve a cron job (or a Windows Scheduler task if running on Windows).
 
Rob Spoor
Sheriff
Pie
Posts: 20368
43
Chrome Eclipse IDE Java Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gana rajan wrote:i've create batch file which run on windows and sh file which run on linux. i did not ask you to provide the full coding. but, ask you to show me the way on how to do it.

And you've shown yourself there is no OS independent way, as you've already had to create two separate batch files.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic