This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Linux / UNIX and the fly likes Execute script placed on a remote unix box Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Reply Bookmark "Execute script placed on a remote unix box" Watch "Execute script placed on a remote unix box" New topic
Author

Execute script placed on a remote unix box

Mohtashim Shaikh
Ranch Hand

Joined: Jul 18, 2010
Posts: 43
So, is there way of automating this ?

My ultimate goal is to run some cmd script in windows and it should connect to a remote unix host and run a script x.sh located on the remote unix host.

I was wanting to achieve this by using WinSCP and Putty only. If possible let me know how and if not then what is the minimum number of tools I can use to achieve this and how.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 14491
    
    7

This is actually a fairly common thing to do. I've even got a production system of my own that does this.

Basically, you can use a single "ssh" command that logs in and executes a single command within the context of the logged-in user (in other words, the script already has to be present on the target machine). Then it logs out.

I'm almost totally certain that the PuTTY toolset has a command-line ssh program that will do that for Windows users.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Execute script placed on a remote unix box
 
Similar Threads
Executing a script on a remote unix system with user other than root using java
Using Java to run shell script on Unix server installed on remote macine
Using Java to run shell script on Unix server installed on remote macine
Unix With Java....
Status of a process