freebsd-dev/usr.sbin/periodic/periodic.8

138 lines
4.3 KiB
Groff
Raw Normal View History

.\" Copyright (c) 1997 FreeBSD, Inc.
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
1998-12-29 22:45:15 +00:00
.\" $Id: periodic.8,v 1.7 1998/03/23 08:26:50 charnier Exp $
.\"
1997-08-13 16:27:59 +00:00
.Dd 13 August 1997
.Os FreeBSD 3.0
1997-08-13 16:27:59 +00:00
.Dt PERIODIC 8
.Sh NAME
.Nm periodic
1997-08-13 16:27:59 +00:00
.Nd
run periodic system functions
.Sh SYNOPSIS
.Nm periodic
.Ao
.Cm daily | weekly | monthly |
.Ar path Op path ...
.Ac
.Sh DESCRIPTION
The
.Nm
program is intended to be called by cron(8) to execute shell scripts
located in the specified directory.
.Pp
One, and only one, of the following arguments should be specified:
.Bl -tag -width Fl
.It Cm daily
Perform the standard daily periodic executable run.
This usually occurs early in the morning (local time).
.It Cm weekly
Perform the standard weekly periodic executable run.
This usually occurs on Sunday mornings.
.It Cm monthly
Perform the standard monthly periodic executable run.
This usually occurs on the first day of the month.
.It Ar path
An absolute path to a directory containing a set of executables to be run.
.El
.Pp
The
.Nm
program will run each executable file in the directory or directories
specified. If a file does not have the executable bit set, it will be
ignored silently.
.Sh ENVIRONMENT
The
.Nm
command sets the
.Ev PATH
environment to include all standard system directories, but no additional
directories, such as
.Pa /usr/local/bin .
If executables are added which depend upon other path components, each
executable must be responsible for configuring its own appropriate environment.
.Sh FILES
1997-08-16 17:08:35 +00:00
.Bl -tag -width /etc/periodic
.It Pa /etc/crontab
The
.Nm
program is typically called via entries in the system default cron table.
1997-08-16 17:08:35 +00:00
.It Pa /etc/periodic
The top level directory containing
.Pa daily ,
.Pa weekly ,
and
.Pa monthly
subdirectories which contain standard system periodic executables.
.It Pa /etc/rc.conf
The
.Pa rc.conf
system registry contains a variable
.Va local_periodic
which may be configured to specify additional top level standard
periodic directories, such as
1997-08-16 17:08:35 +00:00
.Pa /usr/local/etc/periodic
and
1997-08-16 17:08:35 +00:00
.Pa /usr/X11R6/etc/periodic .
.El
.Sh EXAMPLES
The system crontab should have entries for
.Nm
similar to the following example:
.Pp
.Dl # do daily/weekly/monthly maintenance
.Dl 0 2 * * * root periodic daily 2>&1
.Dl 0 3 * * 6 root periodic weekly 2>&1
.Dl 0 5 1 * * root periodic monthly 2>&1
.Pp
Additionally, the system registry will typically have a
.Va local_cron
variable reading:
1997-08-16 17:08:35 +00:00
.Dl local_cron="/usr/local/etc/periodic /usr/X11R6/etc/periodic" # cron script dirs.
.Sh SEE ALSO
.Xr sh 1 ,
.Xr crontab 5 ,
.Xr rc.conf 5 ,
.Xr cron 8
.Rs
.Sh DIAGNOSTICS
1998-12-29 22:45:15 +00:00
Exit status is 0 on success and 1 if the command
fails for one of the following reasons:
.Bl -diag
.It usage: periodic <directory of files to execute>
No directory path argument was passed to
.Nm
to specify where the script fragments reside.
.It <directory> not found
Self explanatory.
.El
.Sh HISTORY
The
.Nm
program first appeared in
.Fx 3.0 .
.Sh AUTHORS
.An Paul Traina Aq pst@FreeBSD.org