update a common file in different/remote servers


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting update a common file in different/remote servers
# 1  
Old 11-09-2008
update a common file in different/remote servers

Dear All, I need to update a common file (ie. same path and same filename) but located in different servers. (ie. remotely located ~ able to ssh from my server). Can someone help me how to go ahead with this? (Since I'm manually editing that file in 20 servers Smilie)
# 2  
Old 11-09-2008
Is the file identical on all servers? If so, just edit it in one place and scp the updated file to all of them.

Otherwise it depends on what kind of edit you are doing; is it something that can be achieved with a simple search-and-replace? If so, try scripting it in sed, and then running it through an ssh command. Be careful of quoting rules though!
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Diff on remote servers file systems

Iam trying to compare two file systems on two hosts basically to check them to be in sync I dont have rsync so trying to use diff Let me know how to do it.... Thanks (3 Replies)
Discussion started by: baanprog
3 Replies

2. UNIX for Dummies Questions & Answers

Help with Copying files between two remote servers

Hi All, Please help me for a shell. I am a New to unix I am trying to DB dump file from one server and copying it to another server. From My Local ServerA connecting to remote ServerB using ssh and taking dump of a instance. That Dump file i need to copy to ServerC. I am able to connect... (6 Replies)
Discussion started by: maddyd2k
6 Replies

3. Shell Programming and Scripting

Shell script to read from a file and update remote server

Its a tough one and would appreciate any guidance for a script that i am trying to develop....Again I do understand its a complicated script and help would be greatly appreciated.... Thank you 1- Need to check for a file (in a certain location on a server) every 15 minute or so if it is there... (4 Replies)
Discussion started by: aavam
4 Replies

4. Red Hat

RHN - Proxy, satellite etc. How do you update you servers?

Hi, I'd like to know more about RHN and their RHN PROXY. - If I will buy PROXY, do I need to get licenses for all my RHELs to have them updated? What are benefits of proxy? - If I will buy (doubt it) Satellite, will I be able to connect all my boxes to Satellite and have them upgraded... (5 Replies)
Discussion started by: columb
5 Replies

5. Shell Programming and Scripting

Status of remote servers

hi, Say me the command to check the status of server. whether its up or down (11 Replies)
Discussion started by: satheeshkr_cse
11 Replies

6. Shell Programming and Scripting

Append Text To Remote Servers File Via SSH

Gentleman & Ladies, Please make me feel like and novice and explain why this is not working? I am attempting to ssh to a remote server via ssh and keys. I want to inject a file on the remote server with text. I am not achieving this. I would like to echo/inject the text on the remote... (1 Reply)
Discussion started by: abacus
1 Replies

7. Shell Programming and Scripting

Copy a file on remote servers

Hey Unix Gurus, I'm having trouble in copying a file on 5 different servers, first how can you do it locally (i.e without the need to ssh to the server you want to copy the file) and if you need to ssh how do u run a command within that server. Please see my code below(it doesn't work somehow).... (10 Replies)
Discussion started by: sexyTrojan
10 Replies

8. Shell Programming and Scripting

unix shell script which inserts some records into a file located in remote servers...

All, I need to write an unix shell script which inserts some records into a file located in remote servers. * Get the input from the user and insert according the first row. It should be in ascending order. 123451,XA,ABA 123452,XB,ABB 123453,XC,ABC 123455,XE,ABE 123456,XF,ABF 123458,XG,ABG... (2 Replies)
Discussion started by: techychap
2 Replies

9. Shell Programming and Scripting

restore mysql dump file in many remote servers?

Hi all, I want to restore DB file in many mysql servers, i already using script for sending the dumpfile in all servers, but it's just annoying if i have to restore the dumpfile in all servers, i want just execute 1 script, and will restore in all remote mysql servers. I make script but not... (2 Replies)
Discussion started by: blesets
2 Replies

10. Shell Programming and Scripting

Connecting to remote servers

Please advise, The previous thread asked about the automated transfer of files between two servers. The question is - is there any way of encrypting the password within the script or is it a matter of setting the permissions settings on the script so that it can only be executed and possibly... (1 Reply)
Discussion started by: rdbooth
1 Replies
Login or Register to Ask a Question