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):
Shutdown web services on remote UNIX server.
FTP (ie, get) various files/folders from the UNIX server to Windows
client.
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.
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.