From 04b214cc57508be6c1b1b820f54bece5b44161f6 Mon Sep 17 00:00:00 2001 From: maja Date: Sun, 20 Apr 1997 10:08:34 +0000 Subject: [PATCH] Added scripts to be used from cron to make sure a slave server is up to date. -moj --- usr.sbin/ypserv/ypxfr/Makefile | 13 ++++++++++++- usr.sbin/ypserv/ypxfr/ypxfr.8 | 18 ++++++++++++++++-- usr.sbin/ypserv/ypxfr/ypxfr_1perday.sh | 16 ++++++++++++++++ usr.sbin/ypserv/ypxfr/ypxfr_1perhour.sh | 11 +++++++++++ usr.sbin/ypserv/ypxfr/ypxfr_2perday.sh | 10 ++++++++++ 5 files changed, 65 insertions(+), 3 deletions(-) create mode 100644 usr.sbin/ypserv/ypxfr/ypxfr_1perday.sh create mode 100644 usr.sbin/ypserv/ypxfr/ypxfr_1perhour.sh create mode 100644 usr.sbin/ypserv/ypxfr/ypxfr_2perday.sh diff --git a/usr.sbin/ypserv/ypxfr/Makefile b/usr.sbin/ypserv/ypxfr/Makefile index 82a6f633857..fe1a3ceff79 100644 --- a/usr.sbin/ypserv/ypxfr/Makefile +++ b/usr.sbin/ypserv/ypxfr/Makefile @@ -1,9 +1,20 @@ -# $OpenBSD: Makefile,v 1.2 1996/05/30 09:53:34 deraadt Exp $ +# $OpenBSD: Makefile,v 1.3 1997/04/20 10:08:34 maja Exp $ PROG= ypxfr SRCS= ypxfr.c ypdb.c yplog.c yplib_host.c ypxfr_xdr.c MAN= ypxfr.8 +MLINKS= ypxfr.8 ypxfr_1perhour.8 \ + ypxfr.8 ypxfr_2perday.8 \ + ypxfr.8 ypxfr_1perday.8 +SCRIPTS= ypxfr_1perhour.sh ypxfr_2perday.sh ypxfr_1perday.sh + .PATH: ${.CURDIR}/../common CFLAGS+=-I${.CURDIR}/../common +beforeinstall: +.for script in ${SCRIPTS} + ${INSTALL} ${COPY} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE} \ + ${.CURDIR}/${script} ${DESTDIR}${BINDIR}/${script:R} +.endfor + .include diff --git a/usr.sbin/ypserv/ypxfr/ypxfr.8 b/usr.sbin/ypserv/ypxfr/ypxfr.8 index 58db984a9b0..5a78dadaf8b 100644 --- a/usr.sbin/ypserv/ypxfr/ypxfr.8 +++ b/usr.sbin/ypserv/ypxfr/ypxfr.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: ypxfr.8,v 1.4 1996/06/26 21:26:41 maja Exp $ +.\" $OpenBSD: ypxfr.8,v 1.5 1997/04/20 10:08:35 maja Exp $ .\" Copyright (c) 1994 Mats O Jansson .\" All rights reserved. .\" @@ -28,7 +28,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.\" $OpenBSD: ypxfr.8,v 1.4 1996/06/26 21:26:41 maja Exp $ +.\" $OpenBSD: ypxfr.8,v 1.5 1997/04/20 10:08:35 maja Exp $ .\" .Dd August 18, 1994 .Dt YPXFR 8 @@ -48,6 +48,14 @@ .Nm ypxfr is the utiliy in YP that transfers maps to the local host. .Pp +Since the YP master transfers a map when it has changed, an YP slave should +check for missed maps regulary. This can be done via an entry in +.Xr crontab 5 . +The scripts +.Ar ypxfr_1perhour , ypxfr_2perday +and +.Ar ypxfr_1perday +could be used for that. .Pp The options are as follows: .Bl -tag -width indent @@ -70,6 +78,12 @@ Specify a source domain other than the target domain. This option is only used by ypserv. This is to open communication with an yppush on another host. .El +.Sh FILES +.Bl -tag -width /usr/sbin/ypxfr_1perhour -compact +.It Pa /usr/sbin/ypxfr_1perhour +.It Pa /usr/sbin/ypxfr_2perday +.It Pa /usr/sbin/ypxfr_1perday +.El .Sh SEE ALSO .Xr yp 8 , .Xr yppush 8 , diff --git a/usr.sbin/ypserv/ypxfr/ypxfr_1perday.sh b/usr.sbin/ypserv/ypxfr/ypxfr_1perday.sh new file mode 100644 index 00000000000..578c268557b --- /dev/null +++ b/usr.sbin/ypserv/ypxfr/ypxfr_1perday.sh @@ -0,0 +1,16 @@ +#!/bin/sh +# $OpenBSD: ypxfr_1perday.sh,v 1.1 1997/04/20 10:08:36 maja Exp $ +# +# ypxfr_1perday.sh - YP maps to be updated daily +# + +/usr/sbin/ypxfr group.byname +/usr/sbin/ypxfr group.bygid +/usr/sbin/ypxfr protocols.byname +/usr/sbin/ypxfr protocols.bynumber +/usr/sbin/ypxfr networks.byname +/usr/sbin/ypxfr networks.byaddr +/usr/sbin/ypxfr services.byname +/usr/sbin/ypxfr rpc.bynumber +/usr/sbin/ypxfr ypservers +/usr/sbin/ypxfr amd.home diff --git a/usr.sbin/ypserv/ypxfr/ypxfr_1perhour.sh b/usr.sbin/ypserv/ypxfr/ypxfr_1perhour.sh new file mode 100644 index 00000000000..82f43a22a5e --- /dev/null +++ b/usr.sbin/ypserv/ypxfr/ypxfr_1perhour.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# $OpenBSD: ypxfr_1perhour.sh,v 1.1 1997/04/20 10:08:37 maja Exp $ +# +# ypxfr_1perhour.sh - YP maps to be updated every hour +# + +/usr/sbin/ypxfr passwd.byname +/usr/sbin/ypxfr passwd.byuid +/usr/sbin/ypxfr master.passwd.byname +/usr/sbin/ypxfr master.passwd.byuid +/usr/sbin/ypxfr netid.byname diff --git a/usr.sbin/ypserv/ypxfr/ypxfr_2perday.sh b/usr.sbin/ypserv/ypxfr/ypxfr_2perday.sh new file mode 100644 index 00000000000..0905270424b --- /dev/null +++ b/usr.sbin/ypserv/ypxfr/ypxfr_2perday.sh @@ -0,0 +1,10 @@ +#!/bin/sh +# $OpenBSD: ypxfr_2perday.sh,v 1.1 1997/04/20 10:08:38 maja Exp $ +# +# ypxfr_2perday.sh - YP maps to be updated twice a day +# + +/usr/sbin/ypxfr hosts.byname +/usr/sbin/ypxfr hosts.byaddr +/usr/sbin/ypxfr ethers.byaddr +/usr/sbin/ypxfr ethers.byname -- 2.20.1