convert linux script to run on windows xp

Posted on 2009-05-28
Medium Priority
Last Modified: 2013-12-21
I have the following working script on my local linux box in my home dir named deploy:

cd /home/revo/test3 && \
grails clean && \
grails prod war test39.war && \
echo "scp to remote"
scp ~/test3/test39.war root@ && \
echo "tomcat stop"
ssh root@ "/etc/init.d/tomcat stop" && \
ssh root@ "rm -rf /usr/local/tomcat/webapps/ROOT/*" && \
ssh root@ "cd /usr/local/tomcat/webapps/ROOT ; /usr/java/jdk/bin/jar -xvf /root/uploads/test39.war"  && \
ssh root@ "/etc/init.d/tomcat start" && \
echo "all done"

I simply type ./deploy in terminal to deploy the whole thing to remote server from my local linux box.

Now I need to port above to my local Win XP box. Assume the script would be located at C:\ and instead of /home/revo/test3, I have C:/test3 folder on Win XP and have the same executable program grails on Win XP. Also on Linux I have ssh-add to connect with the remote server with passsword preauthenticated before the  script is run. But on Win XP there is no such setup. Assume the remote server credentials:  user name: root  password: pswd  So when you port above script to Win XP , it should also take care of this. On Win XP I have Putty installed.
So please rewrite above script to run in Win XP given the details above.
Question by:zenguru

Accepted Solution

dcesari earned 1500 total points
ID: 24491701
If you install cygwin (http://www.cygwin.com/) you can probably use it unmodified, apart from converting pathnames such as /home/revo/test3, and putty will not be needed as well.

Don't know exacly for the passwordless ssh, but I'm sure also on Cygwin you can put your own private/public key in .ssh (or generate them with ssh-keygen) and then use that public key for authentication on the remote ssh server.

Author Comment

ID: 24491900
I am looking for a solution without cygwin probably converting above script to some sort of windows .bat file. Yes on linux I had setup public and private keys using ssh-keygen.

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Virtualization software lets you run different versions of Windows, Ubuntu Linux and other versions of Linux all at the same time, rather than running each one directly from your computer's hard drive.
This tutorial shows a simple method of resetting a forgotten Windows 10 Password, on both a Physical and VM VirtualBox machine without the need for any third-party tools. Both Local and Microsoft Connected accounts are covered. Enjoy...
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

600 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