Need to regularly merge two passwd files

Need to regularly merge two passwd files

Post by Paul Southwor » Tue, 28 Nov 1995 04:00:00



I need to merge the passwd files on two systems on a regular basis.
One runs HP/UX and the other runs SunOS.  No shadow passwds in use.
Wondering if someone has already written some scripts (awk,perl,sh?)
that might do this.

The Sun needs to get every account, except the system accounts, that
exists on the HP.  The HP does not need the accounts from the Sun.  The
Sun also needs some additional accounts that aren't kept on the HP (ie,
locally added on the Sun and not in the HP passwd file).  So
essentially what I need is something that can take the HP passwd file
and integrate it into the Sun passwd file -- if any new or changed
entries appear in the HP passwd file, they get added/replaced in the
Sun passwd file.

A script to do the merging properly is all I am looking for.

The Sun can trust the HP completely.

NIS/YP need not apply.

Any ideas?

--
Paul Southworth

 
 
 

Need to regularly merge two passwd files

Post by Dan Strombe » Fri, 01 Dec 1995 04:00:00


I'd suggest, in order of greatest to least viability/workability:

1) NIS (I know you don't like it, but it's a far preferrable solution)
2) Keep three distinct files, one with system accounts, one from Sun,
   one from HP.  Merge them with cat.  Be careful to keep uid's unique
3) Keep two files, as you've sketched below.  Again, be careful to
   keep uid's unique (see a pattern here?).  Arbitrarily choose
   some uid range (EG, 0-99) for system accounts.  Use a small awk
   script to merge them - tossing 0-99 as needed, on one, keeping on
   the other.  This is probably about three lines of awk.

I used to use option #2 for a small cluster of IBM RT's running MSD
2.6; they had no NIS.  I wished I'd had NIS.



>I need to merge the passwd files on two systems on a regular basis.
>One runs HP/UX and the other runs SunOS.  No shadow passwds in use.
>Wondering if someone has already written some scripts (awk,perl,sh?)
>that might do this.


 
 
 

1. How to merge two columns of numbers from two different files?

Hi there:

        I have two data files which have more than a few columns of numbers.
I want to pick certain column from each file and merge them together into a
third file.  How to do this?  Too bad awk only takes one input file

Regards

2. 3D Blaster support for SVGAlib or X?

3. Merging a passwd file (best approach?)

4. Solaris 2.6 - Soundblaster card

5. Can I merge two files into one?

6. Sudden suprising system slowness

7. Sorting two files, then merging

8. Mach64 - problems with a newer card...

9. Merge of two files

10. ** Merging Two Text Files Parallel **

11. Merging two TXT files

12. How to merge two files with awk