LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-28-2012, 04:05 AM   #1
polishpt
LQ Newbie
 
Registered: Mar 2012
Posts: 2

Rep: Reputation: Disabled
stop remote service and after it's stopped start it again


Hi,
i need some help.
I have 2 hosts.

One of them is running tomcat.

I need a cron script running on a second machine that will remotely stop tomcat, and check if it's stopped.

How can i achive that?
 
Old 03-28-2012, 04:40 AM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Run "cron -e" to edit your crontab, and configure it to run at whatever interval you need, to run your script. As far as your script, you can use SSH to achieve this. As an example, see the following:
Code:
ssh user@host <command and/or script>
If you need any other help, don't hesitate to ask.

Cheers!

Josh
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to start and stop squid service ? gardenair Linux - Networking 5 08-24-2014 05:13 AM
start and stop telnet service on Linux Hi_This_is_Dev Linux - Server 6 09-22-2010 12:53 AM
[SOLVED] Start/stop SSH service? dilzniksan Debian 3 06-12-2010 08:47 PM
Can't start/stop Mysql Service dereko Linux - Server 1 06-28-2009 03:20 PM
start/stop service on the fly zchoyt Linux - Software 3 04-14-2005 03:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:39 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration