how to remotely administer/validate UNIX server via Windows machine?

Hi there--I think this is more of a Windows question, but I think many of you might be able to help me out:

I have a UNIX web server and a Windows machine. I'm trying to script the following tasks so that they can be run from the Windows machine (via a
batch file):

  1. Shutdown web services on remote UNIX server.
  2. FTP (ie, get) various files/folders from the UNIX server to Windows
    client.
  3. Startup web services on the UNIX server.

I can accomplish #1 using putty's "plink" command, but I need help
figuring out how to get my Windows script to validate that the "Web
Services shutdown"
completes successfully before it attempts to FTP (ie, get) the UNIX
files.

Also, I'd appreciate any ideas for getting my Windows script to
validate the "Web Services startup" completes successfully.

Please let me know your thoughts.

Thanks in advance!

Install cygwin (http://www.cygwin.com/\) on the Windows machine and pretend that it is a UNIX box. Assuming you do a fairly complete install once you are running in Cygwin's bash shell, you will feel (mostly) like you are on a Linux box.

If you will be doing a lot interactively, I would highly suggest using Cygwin's rxvt as your terminal rather than Cygwin's default of running bash in a cmd window. Contrary to somewhat popular belief, Cygwin's port of rxvt does not require an X server to be running.

If you do this periodically, to me it looks like a simple cron job in the unix box.
Even If you want to do it on demand, still just make the script in the unix box and execute it from your putty xterm.

i want to log in to unix from window machine (batch file) and run a script (ksh) on unix

how do i do from plink

plink username@password "server name" scriptname ??

does not work... any help appreciated

or still better i can run the whole script from batch file on windo

say
telnet severname
username
password

ksh
for i in $(cat vidpurge)
do
rm i
done
quit

any help appreciated...

I think you have the wrong syntax for plink. Here's what I used to connect via ssh:

plink -ssh -pw [password] [username]@[host] [script]

C:\>plink -ssh -pw [password] [username]@[sername]

give me an error

Unable to open connection:
Host does not exist

I usually do telnet/ftp to the server using sername no problem

do i have to do some setting in putty or i have spaces worng????

new to both putty & unix

thanks for your help :smiley: