YPXFR(8)

πŸ“¦
version 4.2 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– YPXFR(8) πŸ’–

okay bestie, welcome to ypxfr β€” she's a little NIS queen from the NIS Reference Manual, and she lives at /usr/lib/yp/ypxfr. Her whole thing? Transferring an NIS database from a remote server to your local host. No cap. πŸ¦‹


✨ SYNOPSIS ✨

/usr/lib/yp/ypxfr [-f] [-c] [-d target domain] [-h source host]
                  [-s source domain]
                  [-C taskid program-number host port] [-p yp_path]
                  mapname...

🌸 DESCRIPTION 🌸

So ypxfr copies an NIS database from one NIS server over to the local host, and it does it by using the NIS service. Periodt. πŸ’…

Most of the time you're not even the one calling her β€” she gets invoked by ypinit, or by ypserv when ypserv receives a map transfer request from yppush. She's booked and busy.

Here's the routine, step by step:

  1. She creates a temporary map inside the directory /var/yp/domain. Heads up though β€” that directory has to already exist, and domain is the default domainname for the local host. Don't come to her with an empty folder, she will not be building it for you. πŸ™ˆ
  2. She fills that temp map by getting the map's entries, and she fetches the map parameters (master and order number).
  3. If the transfer went well, the old version of the map gets deleted, and the temporary copy gets moved into its place.
  4. Then she'll attempt to send a "clear current map" request to the local ypserv.

Now, the output situation β€” it's giving dual personality, lowkey:

  • If you run her interactively, she writes her output to stderr.
  • If she's invoked without a controlling terminal, she logs the output to syslog instead.

ypxfr is mainly used in environments where you've got several NIS servers kicking around. Here's the lore: for all maps, you have a NIS master server, which maintains the canonical copy of the NIS map, and then all the other servers β€” the NIS slaves β€” copy the new version of the map from the master whenever an update was made. Normally you have one NIS master for all maps. One queen, many devoted followers. πŸ‘‘

To keep everything consistent across all NIS servers, ypxfr can be run periodically in a cron job. Maps that change infrequently only need updating once a day (preferably late at night when system usage is at its lowest, respectfully), whereas maps with frequent changes β€” like passwd.byname and passwd.byuid β€” should be updated perhaps once every hour. Examples are sitting in /usr/lib/yp: ypxfr_1perday, ypxfr_2perday, and ypxfr_1perhour. They can serve as reasonable first cuts. πŸŽ€

Normally all updates should be propagated by yppush when /var/yp/Makefile is run on the NIS master server. However, it's a good practice on large networks where possible outages could cause NIS slaves to fall out of sync with the master. Protect your peace, protect your maps. ✨


πŸ’… OPTIONS πŸ’…

The following options are supported:

  • -f β€” Force a map transfer. Normally ypxfr will not transfer a map if she determines that the NIS master's copy is not newer than the existing copy already on the local host. This flag forces a transfer regardless of which server's version is more recent. She said "I'm doing it anyway." πŸ”₯
  • -c β€” Do not send a "clear current map" request to the ypserv process running on the local host. This flag is normally used when invoking ypxfr by ypinit, or if ypserv is not running locally at the time you're running ypxfr. Otherwise, ypxfr will complain that it cannot talk to the local ypserv, and the transfer will fail. πŸ’€
  • -d domain β€” Specify a domain other than the default NIS domain.
  • -h source host β€” Get the map from host, regardless of what the map says the master is. If host is not specified, ypxfr asks the NIS service for the name of the master, and tries to get the map from there. This option is used to insure that ypxfr only copies maps from the NIS master server. No randos allowed. 🚫
  • -s source domain β€” Specify a source domain from which to transfer a map that should be the same across domains.
  • -C taskid progam-number host port β€” This option is only for use by ypserv. When ypserv invokes ypxfr, it specifies that ypxfr should call back a yppush process at the host with IP address or name host, registered as program number progam-number, listening on port port, and waiting for a response to transaction taskid. (iykyk 🫢)
  • -p yp_path β€” Change the directory for the maps to yp_path/[domainname]/, the default is /var/yp/[domainname].
  • mapname β€” One or more names of the map to transfer.

πŸŽ€ FILES πŸŽ€

/var/yp/[domainname]/[maps]

🌈 SEE ALSO 🌈

ypserv(8), yppush(8), ypinit(8), cron(8), crontab(5)


πŸ‘‘ AUTHOR πŸ‘‘

Thorsten Kukuk <kukuk@linux-nis.org>


and that's the whole page, bestie, you ate that πŸ’– this lil masterpiece is from the NIS Reference Manual, dated 12/31/2020, and it signs off as YPXFR(8). go forth and sync those maps, icon. βœ¨πŸ¦‹πŸ’œ