LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-10-2016, 07:02 AM   #1
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,198
Blog Entries: 4

Rep: Reputation: 131Reputation: 131
Recommendation On How to Automate Commands Across Multiple Servers


I'm not sure if I'm asking this the correct way or if this is coming across as a dumb question. The environment I work in right now isn't mature enough for Chef/Puppet.

However the other day, I had to transfer a .zip file to all of my Linux servers. Thankfully I wrote a script that used scp and moved that file along with another accompanying script to all of the servers, which was awesome and saved so much time and typing.

However from there, it became all manual work on each server:

- cleaning up the old files from a previous .zip file
- uncompressing the .zip file
- deleting the .zip file that was just uncompressed
- moving script to correct directory
- running script
- move output of .html to main server

Does anyone have recommendations on how to automate all of this and run it from one server? Or is it not possible?
 
Old 03-10-2016, 09:05 AM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 919
Blog Entries: 13

Rep: Reputation: 124Reputation: 124
Hi,

Two assumptions :
a) You are allowed to execute commands on the remote server.
b) the cleanup, decompression et al processes are exactly the same on all the servers.

SSH allows you to directly execute a command on the remote server.
ssh user@host [command]

This is the very first approach I'd try.

Serafean.
 
2 members found this post helpful.
Old 03-10-2016, 09:08 AM   #3
JockVSJock
Senior Member
 
Registered: Jan 2004
Location: SATX
Distribution: RHEL/CentOS
Posts: 1,198
Blog Entries: 4

Original Poster
Rep: Reputation: 131Reputation: 131
Quote:
Originally Posted by serafean View Post
Hi,

SSH allows you to directly execute a command on the remote server.
ssh user@host [command]

This is the very first approach I'd try.

Serafean.
Ok, so I need to look at this approach and use ssh to issue commands on the server. I have ssh keys enabled for a regular user, not root. So if I were to go this route, it would have to be a regular user issuing commands.

Maybe look at examples online to get a better sense of it.
 
Old 03-10-2016, 09:13 AM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 919
Blog Entries: 13

Rep: Reputation: 124Reputation: 124
Very first online example I found : Example
S.
 
1 members found this post helpful.
  


Reply

Tags
automation, scripting


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to automate installation commands? ASTRAPI Linux - Newbie 4 04-28-2014 04:33 PM
trying to automate wget commands Spawn10 General 5 09-22-2010 10:49 PM
Automate Commands at Boot up Ace Blackwell Linux - Newbie 1 04-21-2008 01:09 PM
LXer: Execute commands simultaneously on multiple servers LXer Syndicated Linux News 0 02-20-2006 12:31 PM
LXer: Execute Commands on Multiple Linux or UNIX Servers LXer Syndicated Linux News 0 12-27-2005 07:46 PM


All times are GMT -5. The time now is 03:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration