YPXFR(8)
π 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:
- She creates a temporary map inside the directory
/var/yp/domain. Heads up though β that directory has to already exist, anddomainis the default domainname for the local host. Don't come to her with an empty folder, she will not be building it for you. π - She fills that temp map by getting the map's entries, and she fetches the map parameters (master and order number).
- If the transfer went well, the old version of the map gets deleted, and the temporary copy gets moved into its place.
- 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
sysloginstead.
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. Normallyypxfrwill 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 theypservprocess running on the local host. This flag is normally used when invokingypxfrbyypinit, or ifypservis not running locally at the time you're runningypxfr. Otherwise,ypxfrwill complain that it cannot talk to the localypserv, and the transfer will fail. π-ddomain β Specify a domain other than the default NIS domain.-hsource host β Get the map from host, regardless of what the map says the master is. If host is not specified,ypxfrasks the NIS service for the name of the master, and tries to get the map from there. This option is used to insure thatypxfronly copies maps from the NIS master server. No randos allowed. π«-ssource domain β Specify a source domain from which to transfer a map that should be the same across domains.-Ctaskid progam-number host port β This option is only for use byypserv. Whenypservinvokesypxfr, it specifies thatypxfrshould call back ayppushprocess 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 π«Ά)-pyp_path β Change the directory for the maps toyp_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. β¨π¦π
π¦ where this page comes from
- debian bookworm: ypserv 4.2-1+b2 Β· GPL-2.0-only
- debian trixie: ypserv 4.2-2+b2 Β· GPL-2.0-only
- ubuntu jammy: ypserv 4.1-2 Β· GPL-2.0-only
- ubuntu noble: ypserv 4.2-2build2 Β· GPL-2.0-only
- ubuntu questing: ypserv 4.2-2build2
- ubuntu resolute: ypserv 4.2-3 Β· GPL-2.0-only
- ubuntu stonking: ypserv 4.2-3build1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms