Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Batch File for Builds

Posted on 2012-04-03
6
Medium Priority
?
490 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 2000 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 3

Assisted Solution

by:telczj9
telczj9 earned 2000 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 2000 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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Assume you have an outside contractor who comes in seasonally or once a week to do some work in your office, but you only want to give him access to the programs and files he needs and keep all other documents and programs private. Can you do this o…
A quick guide on how to use Group Policy to create a custom power plan and set it active on Windows 7.
This Micro Tutorial will teach you how to the overview of Microsoft Security Essentials. This is a free anti-virus software that guards your PC against viruses, spyware, worms, and other malicious software. This will be demonstrated using Windows…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

609 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