Sponsored Content
Top Forums Shell Programming and Scripting How to synchronise a file to 2 different hosts? Post 302970422 by cjcox on Wednesday 6th of April 2016 11:53:05 AM
Old 04-06-2016
Do you have a backup server or some other host that you could do this forced sync/copy from?

You can cat the two files (from each site) together and sort for uniqueness and push out to both sites.

That's the "easy" way, but assumes that list can be sorted... ok?

If you don't have a 3rd server, then each server does:

site1:
Code:
ssh site2 cat list2.ini >/tmp/list.ini
cat list1.ini >>/tmp/list.ini
sort -u -o /tmp/list.ini /tmp/list.ini
cp /tmp/list.ini list1.ini

site2:
Code:
ssh site1 cat list1.ini >/tmp/list.ini
cat list2.ini >>/tmp/list.ini
sort -u -o /tmp/list.ini /tmp/list.ini
cp /tmp/list.ini list2.ini

That's very rough, no error checking at all.
 

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
PHP_INI_SCANNED_FILES(3)						 1						  PHP_INI_SCANNED_FILES(3)

php_ini_scanned_files - Return a list of .ini files parsed from the additional ini dir

SYNOPSIS
string php_ini_scanned_files (void ) DESCRIPTION
php_ini_scanned_files(3) returns a comma-separated list of configuration files parsed after php.ini. These files are found in a directory defined by the --with-config-file-scan-dir option which is set during compilation. The returned configuration files also include the path as declared in the --with-config-file-scan-dir option. RETURN VALUES
Returns a comma-separated string of .ini files on success. Each comma is followed by a newline. If the directive --with-config-file-scan- dir wasn't set, FALSE is returned. If it was set and the directory was empty, an empty string is returned. If a file is unrecognizable, the file will still make it into the returned string but a PHP error will also result. This PHP error will be seen both at compile time and while using php_ini_scanned_files(3). EXAMPLES
Example #1 A simple example to list the returned ini files <?php if ($filelist = php_ini_scanned_files()) { if (strlen($filelist) > 0) { $files = explode(',', $filelist); foreach ($files as $file) { echo "<li>" . trim($file) . "</li> "; } } } ?> SEE ALSO
ini_set(3), phpinfo(3), php_ini_loaded_file(3). PHP Documentation Group PHP_INI_SCANNED_FILES(3)
All times are GMT -4. The time now is 10:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy