Sponsored Content
Top Forums Shell Programming and Scripting How to synchronise a file to 2 different hosts? Post 302970316 by cterra on Tuesday 5th of April 2016 07:42:51 AM
Old 04-05-2016
How to synchronise a file to 2 different hosts?

Hello,

We ve got 2 sites (Site1, Site2), joined thanks vpn.
We had 2 differents files with a list of all host in each sites.
Server1 has list1.ini, and Server2 has list2.ini

everyone from Site1 update list1.ini by ssh or script to Server1
everyone from Site2 update list2.ini by ssh or script to Server2

Actually, we wants to have only one file, but users from Site1 still wants to update list1.ini
and users from Site2 still wants to update list2.ini

Maybe later, they will be Ok to reach another uniq file, but for now it's like that ...

Is there a command to synchronize list1.ini and list2.ini up to date everytime someone modify it ?

I think, it can be easy to upgrade scripts, but some users still modify this file by hand (the time our uniq file is validate), cause it's THEIR file !! Nevermind ...


At the begining i thought to make some diff/rsync ... but the problem is, it will not be able to update for a host deleted from the list, it can only see adds ?


I hope i was clear, english is not my natal langage ... i just want to synchronise a file up to date to 2 differents host whatever we add or delete something from the list file.

Thanks
 

10 More Discussions You Might Find Interesting

1. IP Networking

dns and hosts file

ok i have a question now when i add machines on network that are running unix do i add them in the /etc/hosts file also include them in dns (4 Replies)
Discussion started by: rmuhammad
4 Replies

2. UNIX for Dummies Questions & Answers

hosts.allow & hosts.deny

Hi! Im trying to use host.allow & host.deny to resrtic access to my sun machine, but it doesnt seem to work... I want to allow full access from certain IPīs (ssh,http,ftp,etc...) but deny all kind of conections from outsideworld, the way that im doing that is: hosts.allow ALL:127.0.0.1... (2 Replies)
Discussion started by: Sorrento
2 Replies

3. UNIX for Dummies Questions & Answers

HOSTS File

Hi All, I am to the UNIX world and want to know if I can specify a range of IP addresses instead of having to include one by one on the HOSTS file. Can I just say 127.20.1.1 to 127.20.1.156 ? Or the only way is to put one by one along with the machine name next to the IP ? THANKS (4 Replies)
Discussion started by: cymerman
4 Replies

4. Shell Programming and Scripting

FTP file to different hosts

Guys hw ya all doing.by the way wrote a script which is below. f() { for host in hostname1 hostname2; do { #host=hostname1 user = 'rocky' pass = 'rocky' #ftp to particular server ftp -v $host quote USER $user quote PASS $pass bin cd /bin/rocky mkdir rock cd /bin/rocky/rock/... (4 Replies)
Discussion started by: coolkid
4 Replies

5. AIX

range in hosts file

We have a server that need to have 50 or so entries added to the /etc/hosts file. All the entries will be on the same subnet so i wanted to know if i can add the range to the /etc/hosts file and if so how. (4 Replies)
Discussion started by: daveisme
4 Replies

6. IP Networking

Issue with /etc/hosts file under ubuntu

I think terminal outpu is better than long words so: I rebooted my laptop but no success... It's the same for all entry i added... Any ideas ? PS: I'm under ubuntu 9.0.4 edit: hostnames can't start with a number, using c4507 for example works. (0 Replies)
Discussion started by: nekkro-kvlt
0 Replies

7. UNIX for Dummies Questions & Answers

Can you have multiple mailhost's in the /etc/hosts file?

We recently had an smtp server go down and didn't have a backup. Now that the backup server is up and running, I'd like to set up sendmail on our Solaris 10 servers to failover to the backup mail (smtp) server if the primary refuses connections. I've googled "mailhost" and haven't found... (0 Replies)
Discussion started by: the.gooch
0 Replies

8. UNIX for Dummies Questions & Answers

Hosts file

What are the xid and cid numbers in a host file used for on solaris? If possible can I get a detailed link on the configuration of hosts file explaining xid and cid. :o (1 Reply)
Discussion started by: usm4n
1 Replies

9. AIX

aix tcp wrappers hosts.allow hosts.deny?

hi all just installed the netsec.options.tcpwrapper from expansion pack, which used to be a rpm, for my aix 6.1 test box. it is so unpredictable. i set up the hosts.deny as suggested for all and allow the sshd for specific ip addresses/hostnames. the tcpdchk says the hosts allowed and... (0 Replies)
Discussion started by: wf201626
0 Replies

10. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies
inifile(n)						   Parsing of Windows INI files 						inifile(n)

__________________________________________________________________________________________________________________________________________________

NAME
inifile - Parsing of Windows INI files SYNOPSIS
package require Tcl 8.2 package require inifile ?0.2.3? ::ini::open file ?access? ::ini::close ini ::ini::commit ini ::ini::revert ini ::ini::filename ini ::ini::sections ini ::ini::keys ini section ::ini::get ini section ::ini::exists ini section ?key? ::ini::value ini section key ?default? ::ini::set ini section key value ::ini::delete ini section ?key? ::ini::comment ini section ?key? ?text? ::ini::commentchar ?char? _________________________________________________________________ DESCRIPTION
This package provides an interface for easy manipulation of Windows INI files. ::ini::open file ?access? Opens an INI file and returns a handle that is used by other commands. access is the same as the first form (non POSIX) of the open command, with the exception that mode a is not supported. The default mode is r+. ::ini::close ini Close the specified handle. If any changes were made and not written by commit they are lost. ::ini::commit ini Writes the file and all changes to disk. The sections are written in arbitrary order. The keys in a section are written in alphabet- ical order. If the ini was opened in read only mode an error will be thrown. ::ini::revert ini Rolls all changes made to the inifile object back to the last committed state. ::ini::filename ini Returns the name of the file the ini object is associated with. ::ini::sections ini Returns a list of all the names of the existing sections in the file handle specified. ::ini::keys ini section Returns a list of all they key names in the section and file specified. ::ini::get ini section Returns a list of key value pairs that exist in the section and file specified. ::ini::exists ini section ?key? Returns a boolean value indicating the existance of the specified section as a whole or the specified key within that section. ::ini::value ini section key ?default? Returns the value of the named key and section. If specified, the default value will be returned if the key does not exist. If the key does not exist and no default is specified an error will be thrown. ::ini::set ini section key value Sets the value of the key in the specified section. If the section does not exist then a new one is created. ::ini::delete ini section ?key? Removes the key or the entire section and all its keys. A section is not automatically deleted when it has no remaining keys. ::ini::comment ini section ?key? ?text? Reads and modifies comments for sections and keys. To write a section comment use an empty string for the key. To remove all com- ments use an empty string for text. text may consist of a list of lines or one single line. Any embedded newlines in text are prop- erly handled. Comments may be written to nonexistant sections or keys and will not return an error. Reading a comment from a nonex- istant section or key will return an empty string. ::ini::commentchar ?char? Reads and sets the comment character. Lines that begin with this character are treated as comments. When comments are written out each line is preceded by this character. The default is ;. BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category inifile of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. inifile 0.2.3 inifile(n)
All times are GMT -4. The time now is 02:24 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy