Click here to Skip to main content
13,598,183 members
Click here to Skip to main content
Add your own
alternative version


3 bookmarked
Posted 11 Dec 2012
Licenced CPOL

Push2Linux - A Mass Unix Deploy Tool

, 11 Dec 2012
Rate this:
Please Sign up or sign in to vote.
An Understanding of what it does and how it can help.....


Push2Linux is a deploy tool or rather a mass deploy tool. Consider attempting to deploy a piece of software across 500 Unix/Linux devices and the possible time involved doing it manually. This is where Push2Linux comes in – it tries to simplify the process by managing the deploy of the code for you. This is also a very handy tool for a developer especially in testing.


  1. Deploy software across a single or a large subset of hosts
  2. Execute commands remotely across multiple unixes devices from one location
  3. Execute a script remotely across multiple unix devices
  4. Customize installation to fit your needs with a bash shell script
  5. Restart Services of multiple hosts

How it works? 

Let’s try understand how we can leverage Push2Linux by looking at various scenarios:<o:p />

Scenario 1: Execute Command Across A Host<o:p />

Assume we have Web Server  and we need to restart the ‘Apache Web Service’ on it. In Diagram A below, you can just add in the host name, username and password and then the exact command you would like to execute. In this case we will issue a service restart for Apache.


[Diagram A]  

Scenario 2: Execute Command Across Multiple Hosts 

Firstly you going to need to create a CSV file to be used as the configuration file (input). The format is displayed below, <o:p />

<ip/hostname>, <username>, <password>


 [Diagram B] 

Let’s say I wanted to get the log file for multiple devices and have the log emailed to my address, using this handy one-liner and Push2Linux, this is no problem.

echo "This is the message body" | mutt -a -s "subject of message" 


 [Diagram C]  

Just click - Deploy and you done! 

Scenario 3: Install and setup Software on Multiple Hosts 

In the third scenario, let us assume we have some custom software we have written in Java or Ruby and we would like to deploy it across a mass of hosts. We obviously create our CSV file, adding in the devices and their authentication details. <o:p />

Following along with Diagram D, we tick the ‘Use Zipped Archive’ checkbox. That will provide you with the following options:

  1. Archive: a zip compressed file (no spaces in name) containing the files or software you would like to deploy. PS. This needs to include the setup script for your planned installation, in this case it’s called
  2. Copy to Archive: is the remote location to which the files will be copied on the remote host and from where you will commence to execute your setup script.
  3. Checkbox Unzip: This is used if the file you are attaching is Zip compressed
  4. Checkbox Script: This is important to take note off. If this is unticked that means the file attached is just a script (a bash script) which Push2Linux will SCP across, and then execute using the Command Option with full path. 

[Diagram D] 

Lastly the Command Option below is the full path the script file you would like to execute. 

Points of Interest  

This is the basics of Push2Linux, a mass deploy tool. I’ve also built in asynchronous call back to kill connections when they are taking too long. I noticed on some larger deployments that SCP/SSH on certain machines hang or never return. Though rare, the Push2Linux should take care of this. 

Attached is full source code with Project File, including Installer.  

Requirements for Remote Hosts:

  1. Dos2Unix  - used to convert scripts to unix format unless control characters from windows will break script execution
  2. Unzip/Zip 


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Dane Balia
Software Developer (Senior) Senwes
South Africa South Africa
Hacking at code.....

You may also be interested in...


Comments and Discussions

QuestionSSH keys? Pin
CherryDT3-Nov-15 4:25
memberCherryDT3-Nov-15 4:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Cookies | Terms of Use | Mobile
Web03-2016 | 2.8.180621.3 | Last Updated 11 Dec 2012
Article Copyright 2012 by Dane Balia
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid