xref: /freebsd/usr.sbin/periodic/periodic.8 (revision b601c69bdbe8755d26570261d7fd4c02ee4eff74)
1.\" Copyright (c) 1997 FreeBSD, Inc.
2.\" All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\"    notice, this list of conditions and the following disclaimer in the
11.\"    documentation and/or other materials provided with the distribution.
12.\"
13.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23.\" SUCH DAMAGE.
24.\"
25.\" $FreeBSD$
26.\"
27.Dd 13 August 1997
28.Os FreeBSD 3.0
29.Dt PERIODIC 8
30.Sh NAME
31.Nm periodic
32.Nd
33run periodic system functions
34.Sh SYNOPSIS
35.Nm periodic
36.Ao
37.Cm daily | weekly | monthly |
38.Ar path Op path ...
39.Ac
40.Sh DESCRIPTION
41The
42.Nm
43program is intended to be called by cron(8) to execute shell scripts
44located in the specified directory.
45.Pp
46One, and only one, of the following arguments should be specified:
47.Bl -tag -width Fl
48.It Cm daily
49Perform the standard daily periodic executable run.
50This usually occurs early in the morning (local time).
51.It Cm weekly
52Perform the standard weekly periodic executable run.
53This usually occurs on Sunday mornings.
54.It Cm monthly
55Perform the standard monthly periodic executable run.
56This usually occurs on the first day of the month.
57.It Ar path
58An absolute path to a directory containing a set of executables to be run.
59.El
60.Pp
61The
62.Nm
63program will run each executable file in the directory or directories
64specified.  If a file does not have the executable bit set,  it will be
65ignored silently.
66.Sh ENVIRONMENT
67The
68.Nm
69command sets the
70.Ev PATH
71environment to include all standard system directories, but no additional
72directories, such as
73.Pa /usr/local/bin .
74If executables are added which depend upon other path components, each
75executable must be responsible for configuring its own appropriate environment.
76.Sh FILES
77.Bl -tag -width /etc/periodic
78.It Pa /etc/crontab
79The
80.Nm
81program is typically called via entries in the system default cron table.
82.It Pa /etc/periodic
83The top level directory containing
84.Pa daily ,
85.Pa weekly ,
86and
87.Pa monthly
88subdirectories which contain standard system periodic executables.
89.It Pa /etc/defaults/periodic.conf
90The
91.Pa periodic.conf
92system registry contains a variable
93.Va local_periodic
94which may be configured to specify additional top level standard
95periodic directories, such as
96.Pa /usr/local/etc/periodic
97and
98.Pa /usr/X11R6/etc/periodic .
99.El
100.Sh EXAMPLES
101The system crontab should have entries for
102.Nm
103similar to the following example:
104.Pp
105.Dl # do daily/weekly/monthly maintenance
106.Dl 0      2       *       *       *       root    periodic daily   2>&1
107.Dl 0      3       *       *       6       root    periodic weekly  2>&1
108.Dl 0      5       1       *       *       root    periodic monthly 2>&1
109.Pp
110Additionally, the
111.Pa /etc/defaults/periodic.conf
112system registry will typically have a
113.Va local_periodic
114variable reading:
115.Pp
116.Dl local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic"
117.Sh SEE ALSO
118.Xr sh 1 ,
119.Xr crontab 5 ,
120.Xr periodic.conf 5 ,
121.Xr cron 8
122.Rs
123.Sh DIAGNOSTICS
124Exit status is 0 on success and 1 if the command
125fails for one of the following reasons:
126.Bl -diag
127.It usage: periodic <directory of files to execute>
128No directory path argument was passed to
129.Nm
130to specify where the script fragments reside.
131.It <directory> not found
132Self explanatory.
133.El
134.Sh HISTORY
135The
136.Nm
137program first appeared in
138.Fx 3.0 .
139.Sh AUTHORS
140.An Paul Traina Aq pst@FreeBSD.org
141