Solved

Executing a remote command on a unix server

Posted on 2004-04-16
6
275 Views
Last Modified: 2012-05-04
How can I execute a unix command on a remote server. This server is different than the server that contains the java class.

I have 3 different unix servers involved. Basically I have to execute a checkout command on server A to get the current version of a file. Then I have to move the file to the production server C.

Thanks
0
Comment
Question by:manishksinha-2004
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
6 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 63 total points
ID: 10845353
You can use a SSH implmentation but it sounds more like you're using CVS to me - why not use a Java CVS implementation?
0
 
LVL 92

Expert Comment

by:objects
ID: 10846366
if this is part of your build process then use ant.
If its your application then here's an example of calling an external command:
http://www.objects.com.au/java/examples/util/ConsoleExec.do
0
 

Author Comment

by:manishksinha-2004
ID: 10859599
How do we use SSH? One of the servers is PVCS versioning software.
 I guess I will still end up using the runtime call in java?
0
 
LVL 92

Assisted Solution

by:objects
objects earned 62 total points
ID: 10864535
> I guess I will still end up using the runtime call in java?

probably.

ant has a task for accessing PVCS, you may be able to take the code from that and use it in your application.
http://ant.apache.org/manual/OptionalTasks/pvcstask.html

0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question