Update remove files


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Update remove files
# 1  
Old 06-20-2017
Update remove files

Howdy.

I'm currently hoping to putty to a number of Linux VMs and update a hosts file remotely before moving on to the next VM in a list. Does anyone have a script that does anything similar? Are there any decent script repositories online?
# 2  
Old 06-20-2017
Welcome seanbeag,

I have a few to questions pose in response first:-
  • How would you do this without automation?
  • What have you tried so far?
  • What output/errors do you get?
  • What OS and version are you using?
  • Do you have security credentials set up on each server? (password-less login for scheduled tasks)
  • What are your preferred tools? (C, shell, perl, awk, etc.)
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Most importantly, What have you tried so far?

There are probably many ways to achieve most tasks, so giving us an idea of your style and thoughts will help us guide you to an answer most suitable to you so you can adjust it to suit your needs in future.


We're all here to learn and getting the relevant information will help us all.



Kind regards,
Robin
This User Gave Thanks to rbatte1 For This Post:
# 3  
Old 06-20-2017
Facebook

Hi Robin, thanks for the response:


  • How would you do this without automation?
Currently the way this is done is by literally consoling onto every virtual machine in the environment. The hosts file is then updated, some software downloaded from an ftp site and the software is then installed. I'm trying to automate the whole process, because this is time consuming and antiquated.
  • What have you tried so far?
I currently have a bash script I run locally where I can update my own hosts file, and one or two remote hosts files, but this is done by tying in the name of each remote machine one by one and I don't really want to go testing this in a virtual environment
  • What output/errors do you get?

  • What OS and version are you using?
As it's a virtual environment there's a mixture of OS types, Windows, CentOS, Linux, OpenSuse etc
  • Do you have security credentials set up on each server? (password-less login for scheduled tasks)
Not presently not. There are certain accounts that will work across multiple VMs though
  • What are your preferred tools? (C, shell, perl, awk, etc.)
I don't really have a preferred tool
  • What logical process have you considered? (to help steer us to follow what you are trying to achieve)
Would ideally like to be able to run a script that will connect to a pre-defined list of remote VMs and:
1 - Update their host file
2 - Copy some install files to a directory on that remote VM and kick off the install
3 - Start the service post install

Most importantly, What have you tried so far?

This is well outside my comfort zone to be honest so I'm hoping for something that may be tried and tested. If that doesn't exist then no worries
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Remove duplicated records and update last line record counts

Hi Gurus, I need to remove duplicate line in file and update TRAILER (last line) record count. the file is comma delimited, field 2 is key to identify duplicated record. I can use below command to remove duplicated. but don't know how to replace last line 2nd field to new count. awk -F","... (11 Replies)
Discussion started by: green_k
11 Replies

2. Shell Programming and Scripting

Bash to update files to be used by awk

In the below bash there are 6 .txt files in /home/cmccabe/Desktop/comparison/ref_val/ that are being updated from the 6 .vcf files in /home/cmccabe/Desktop/comparison/validation/files/*.vcf. The awk in the post updates the files with the information, however the files are not being updated so the... (0 Replies)
Discussion started by: cmccabe
0 Replies

3. Shell Programming and Scripting

How to compare 2 files and update one?

Hi, I have got 2 files which i need to compare and append based on the below conditions. file 1: File 1 has data in the following format 4300 2356 C234 5689 5500 2345 File 2 has data in the same fomat 4300 49 5555 12345 Now i need to compare the first 4 bytes in each line... (4 Replies)
Discussion started by: roy121
4 Replies

4. Solaris

Command to remove existing files in the tar files in Solaris 10

Hi, I am using solaris 10 OS.Please help me out with the commands needed in below two scenarios. 1)How to delete the existing files in the tar file. suppose i have a main tarfile named application.tar and it contains a file called ingres.tar. what is the command to remove ingres.tar... (2 Replies)
Discussion started by: muraliinfy04
2 Replies

5. Shell Programming and Scripting

Remove duplicates and update last 2 digits of the original row with 0's

Hi, I have a requirement where I have to remove duplicates from a file based on the first 8 chars (It is fixed width file of 10 chars length) and whenever a duplicate row is found, its original row's last 2 chars should be updated to all 0's. I thought of using sort -u -k 1.1,1.8... (4 Replies)
Discussion started by: farawaydsky
4 Replies

6. UNIX for Advanced & Expert Users

update files and preserve date

I have a bunch of historical files that need to be modified, as the file source announced there is an error in them which should be corrected. I am planning to use sed to do the mass update, but I would like to know if there is a way to preserve files last modified date/time, so later ls -ltr... (3 Replies)
Discussion started by: migurus
3 Replies

7. Shell Programming and Scripting

Update a column value in csv files

Hi all I am new to scripting and i have an application from which i will export into a csv file as follows Column1, Column2, Column3 Sno1, Folder\Test.txt, Fail Sno2, Folder\Test1.txt, Pass Sno3, Folder\Test2.txt, Fail Now i need to change the column2 in all the rows from "Folder\" ... (1 Reply)
Discussion started by: rajeshrp
1 Replies

8. Shell Programming and Scripting

compare two files and to remove the matching lines on both the files

I have two files and need to compare the two files and to remove the matching lines from both the files (4 Replies)
Discussion started by: shellscripter
4 Replies

9. UNIX for Dummies Questions & Answers

compare update time of files

Hi, does anyone know of a way to compare files update time (not only days - also hours and minutes) (command? scripts? perl scripts?) Dori (8 Replies)
Discussion started by: dorilevy
8 Replies

10. Programming

Check files update

Hi, I want to monitor a file, and check what has been added to it. etc: The text file contain "abcdef" And now it contain "abcdefghi". I need to know what had been added, is there any function that can do this? Thx for helping me. (3 Replies)
Discussion started by: AkumaTay
3 Replies
Login or Register to Ask a Question