Executing a shell script from windows;script present in unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Executing a shell script from windows;script present in unix
# 1  
Old 05-08-2009
Executing a shell script from windows;script present in unix

I need to execute a shell script kept in unix machine from windows. User id, password area available.
For eg.
There's a shell script wich moves all the logs kept in my home directory to a directory named LOGS.
Now i need to get this done through windows; either using a batch file, or java program or any other feasible way.
# 2  
Old 05-08-2009
Way1: Create a batch in windows to ftp files to unix server

Way2: Start ftp services on windows machine, ftp into windows machines from unix server and get the required data.
# 3  
Old 05-08-2009
Clarification

Thanks For the reply.
But actually my requirement is not of getting some files from or to unix.

There's a shell script in unix. I need to get that executed without manually goin into unix.
I want to write a program in windows which will run and execute that shell script.
# 4  
Old 05-08-2009
Quote:
Originally Posted by rajneesh_kapoor
There's a shell script in unix. I need to get that executed without manually goin into unix.
I want to write a program in windows which will run and execute that shell script.
The only way(s) I could think of:

1. In Windoze, install Cygwin and start the Unix script from there (proper network setup as well as revision of the script required);

2. in Windoze, create a Bat(ch) that puts a trigger (my favorite: an empty file named "Godot") on the Unix machine, then create a cron job (in Unix, of course) that scans for this "trigger file" and executes the script if it exists.
# 5  
Old 05-08-2009
If their is such a thing as a command line version of a SSH client for windows ( at SSHWindows.SourceForge.Net: OpenSSH for Windows perhaps?) and you set up SSH keys to allow password-less login then you can then run from a batch file:
Code:
ssh username@machinename.foobar.com /path/command

which will then run "/path/command" as the user "username".

There have been various threads about passwordless SSH before but I will mention the URL ( http://www.jfitz.com/tips/ssh_for_windows.html#Automatic_login ) as it is covering with SSH for Windows.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

how to execute shell script present in unix machine remotely from windows

how to execute shell script present in unix machine remotely from windows? I having a shell script in my unix machine, need to execute the script remotely from my windows machine using Visual Basic or VBA macros. Thanks In Advance. --Suresh (1 Reply)
Discussion started by: sureshmani
1 Replies

2. Shell Programming and Scripting

calling a shell script present on another server using perl script.

Hi, I am working on a sever A. I want to write a perl script to execute a shell script persent on the server B. please help me in this. thanks in advance. (3 Replies)
Discussion started by: anandgodse
3 Replies

3. Shell Programming and Scripting

FTP from windows to unix server using unix shell script

Hi, Is it possible to ftp a huge zip file from windows to unix server using unix shell scripting? If so what command i need to use. thanks in advance. (1 Reply)
Discussion started by: Shri123
1 Replies

4. UNIX for Dummies Questions & Answers

executing SQL query using unix shell script

I want to perform few post-session success tasks like update a status to 'true' in one of the sql database table, update date values to current system date in one of the configuration table in sql. How do i achieve this in a post session command?syntax with example will be helpful. (3 Replies)
Discussion started by: nathanvaithi
3 Replies

5. UNIX for Advanced & Expert Users

Shell script to ftp files from windows to unix

Hi , I need to ftp some input files from windows to unix server.All the files will be saved in the C drive in my machine.Currently all these files are transferring manually to the unix server.I need to write a shell script which ftp the files from windows to unix box.When I searched in the forum i... (1 Reply)
Discussion started by: kavithakuttyk
1 Replies

6. Shell Programming and Scripting

Change the Windows Batch script to UNIX shell script.

Hi, When I run the below script in UNIX it's throwing syntax errors. Actually it's a windows batch script. Could anyone change the below Windows Batch script to UNIX shell script... Script: REM :: File Name : Refresh_OTL.bat REM :: Parameters : %1 - Region REM :: : %2 - Cube Type REM ::... (5 Replies)
Discussion started by: tomailraj
5 Replies

7. Shell Programming and Scripting

Executing unix script on windows through MKSToolkit

hi, I have an unix script and i'm executing from command prompt in windows. The script is exiting immediately when i call the script.But the script is getting executed at the back end. But when i type sh at command prompt i'm getting $ sign and i can see the execution of script. Is there... (5 Replies)
Discussion started by: ammu
5 Replies

8. Shell Programming and Scripting

FTP from unix shell script to windows

Hi, I m trying to connect/establish FTP from unix shell script to my PC.Below the script i have written #!/bin/ksh ftp -v -n ddcappip01.com << "EOF" user Amit jason bye EOF ------------------------------ERROR-------------------------- but i m getting the below error for the... (4 Replies)
Discussion started by: ali560045
4 Replies

9. UNIX for Advanced & Expert Users

Executing shell script from Windows FTP

Hello, Any inputs on the possibility of executing a shell script on unix box from Windows FTP TIA (1 Reply)
Discussion started by: B2BIntegrator
1 Replies

10. Shell Programming and Scripting

FTP Unix Box to Windows Shell Script

Hello All, Could someone help me out with this? I want to incorporate this into an existing script so the output of a SAS job can be ftp'd from our UNIX box to a directory on a drive in Windows environment. Can this be done with no extra third party software? We currently use Putty for copy... (2 Replies)
Discussion started by: Jose Miguel
2 Replies
Login or Register to Ask a Question