Solved

Batch File for Builds

Posted on 2012-04-03
6
485 Views
Last Modified: 2012-04-04
Greetings...
I am attempting to automate my build process (I am new to this).
I control the build on Windows, and the actions are done on Linux.

I would like to be on a windows machine and do the following:
1. Move a file from Windows to Linux Server via SCP
2. Execute commands on Linux Server (the command in question is istools.sh, but I want to be general in case I need to do other things).

If I can write a BAT file that can do this? or a Powershell bat, perhaps?

Looking for ideas...
Thanks.
0
Comment
Question by:Evan Cutler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 7

Expert Comment

by:ZShaver
ID: 37802650
you cannot do this without external utilities available to the system

you will need an SCP client for windows that supports command line functions, as well as an telnet/SSH client that supports command line functions like what you have defined

I would personally instead script this using PHP as it already contains the functionality you need to do all this, and you can make a nice web based interface for it also.
0
 
LVL 3

Assisted Solution

by:telczj9
telczj9 earned 500 total points
ID: 37804128
Yes, you will need external utilities available to your windows system.  These two utilities:

PSCP (an SCP client, i.e. command-line secure file copy)
Plink (a command-line interface to the PuTTY back ends)

from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

tied in with batch scripts allow me to orchestrate an amazing work flow against 100 plus hosts (linux\unix).

Cheers!
0
 
LVL 9

Author Comment

by:Evan Cutler
ID: 37804226
You are awesome telczj9...
any chance on visualizing some of your code?

thanks
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 3

Assisted Solution

by:telczj9
telczj9 earned 500 total points
ID: 37804601
Arcee123,

it will be easier to start with the specific questions on this post:

1. Move a file from Windows to Linux Server via SCP
pscp -l <user_id> -pw <password>  <source> <host_name>:<destination>

Open in new window


or  Move a file from Linux to Windows Server via SCP:
pscp -l <user_id> -pw <password>  <host_name>:<source> <destination>

Open in new window


2. Execute commands on Linux Server (the command in question is istools.sh, but I want to be general in case I need to do other things).
PLINK <host_name> -l <user_id> -pw <password> -t <command>

Open in new window


in the event that that the shell script needs to be executed from directory it resides:
PLINK <host_name> -l <user_id> -pw <password> -t "cd /<dir_1>/<dir_2>/<dir_3> ; ./istools.sh 

Open in new window


Cheers!
0
 
LVL 3

Accepted Solution

by:
telczj9 earned 500 total points
ID: 37804608
You don't have to put your password in clear test if you don't want, you can also plant public keys on the hosts you will be interacting.  In this manner there would be no need to use passwords.  Just hide you private key in your windows host behind permissions so others can not get to it.

Cheers!
0
 
LVL 9

Author Closing Comment

by:Evan Cutler
ID: 37805918
I wish I could put 500 in each of those blocks...
Thanks much.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
Possible fixes for Windows 7 and Windows Server 2008 updating problem. Solutions mentioned are from Microsoft themselves. I started a case with them from our Microsoft Silver Partner option to open a case and get direct support from Microsoft. If s…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…

726 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