📄 periodic.8
字号:
.\" 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..\".\" $FreeBSD: src/usr.sbin/periodic/periodic.8,v 1.11.2.13 2001/12/14 16:48:11 ru Exp $.\".Dd November 28, 2001.Os.Dt PERIODIC 8.Sh NAME.Nm periodic.Nd run periodic system functions.Sh SYNOPSIS.Nm.Ar directory ....Sh DESCRIPTIONThe.Nmprogram is intended to be called by.Xr cron 8to execute shell scriptslocated in the specified directory..PpOne or more of the following arguments must be specified:.Bl -tag -width ".Pa monthly".It Pa dailyPerform the standard daily periodic executable run.This usually occurs early in the morning (local time)..It Pa weeklyPerform the standard weekly periodic executable run.This usually occurs on Sunday mornings..It Pa monthlyPerform the standard monthly periodic executable run.This usually occurs on the first day of the month..It Ar pathAn arbitrary directory containing a set of executables to be run..El.PpIf an argument is an absolute directory name it is used as is, otherwiseit is searched for under.Pa /etc/periodicand any other directories specified by the.Va local_periodicsetting in.Xr periodic.conf 5(see below)..PpThe.Nmprogram will run each executable file in the directory or directoriesspecified.If a file does not have the executable bit set, it is silently ignored..PpEach script is required to exit with one of the following values:.Bl -tag -width 4n.It 0The script has produced nothing notable in its output.The.Ao Ar basedir Ac Ns Va _show_successvariable controls the masking of this output..It 1The script has produced some notable information in its output.The.Ao Ar basedir Ac Ns Va _show_infovariable controls the masking of this output..It 2The script has produced some warnings due to invalid configuration settings.The.Ao Ar basedir Ac Ns Va _show_badconfigvariable controls the masking of this output..It >2The script has produced output that must not be masked..El.PpIf the relevant variable (where.Aq Ar basediris the base directory in which the script resides) is set to.Dq Li NOin.Pa periodic.conf ,.Nmwill mask the script output.If the variable is not set to either.Dq Li YESor.Dq Li NO ,it will be given a default value as described in.Xr periodic.conf 5 ..PpAll remaining script output is delivered based on the value of the.Ao Ar basedir Ac Ns Va _outputsetting..PpIf this is set to a path name (beginning with a.Ql /character), output is simply logged to that file..PpIf the.Ao Ar basedir Ac Ns Va _outputvalue does not begin with a.Ql /and is not empty, it is assumed to contain a list of email addresses, andthe output is mailed to them..PpIf.Ao Ar basedir Ac Ns Va _outputis not set or is empty, output is sent to standard output..Sh ENVIRONMENTThe.Nmcommand sets the.Ev PATHenvironment to include all standard system directories, but no additionaldirectories, such as.Pa /usr/local/bin .If executables are added which depend upon other path components, eachexecutable must be responsible for configuring its own appropriate environment..Sh FILES.Bl -tag -width ".Pa /etc/periodic.conf".It Pa /etc/crontabThe.Nmprogram is typically called via entries in the system default.Xr cron 8table..It Pa /etc/periodicThe top level directory containing.Pa daily ,.Pa weekly ,and.Pa monthlysubdirectories which contain standard system periodic executables..It Pa /etc/defaults/periodic.confThe.Pa periodic.confsystem registry contains variables that control the behaviour of.Nmand the standard.Pa daily , weekly ,and.Pa monthlyscripts..It Pa /etc/periodic.confThis file contains local overrides for the default.Nmconfiguration..El.Sh EXAMPLESThe system crontab should have entries for.Nmsimilar to the following example:.Bd -literal -offset indent# do daily/weekly/monthly maintenance0 2 * * * root periodic daily0 3 * * 6 root periodic weekly0 5 1 * * root periodic monthly.Ed.PpThe.Pa /etc/defaults/periodic.confsystem registry will typically have a.Va local_periodicvariable reading:.Pp.Dl local_periodic="/usr/local/etc/periodic /usr/X11R6/etc/periodic".PpTo log.Nmoutput instead of receiving it as email, add the following lines to.Pa /etc/periodic.conf :.Bd -literal -offset indentdaily_output=/var/log/daily.logweekly_output=/var/log/weekly.logmonthly_output=/var/log/monthly.log.Ed.PpTo only see important information from daily periodic jobs, add thefollowing lines to.Pa /etc/periodic.conf :.Bd -literal -offset indentdaily_show_success=NOdaily_show_info=NOdaily_show_badconfig=NO.Ed.Sh SEE ALSO.Xr sh 1 ,.Xr crontab 5 ,.Xr periodic.conf 5 ,.Xr cron 8.Sh DIAGNOSTICSExit status is 0 on success and 1 if the commandfails for one of the following reasons:.Bl -diag.It usage: periodic <directory of files to execute>No directory path argument was passed to.Nmto specify where the script fragments reside..It <directory> not foundSelf explanatory..El.Sh BUGSSince one specifies information about a directory using shellvariables containing the string,.Aq Ar basedir ,.Aq Ar basedirmust only contain characters that are valid within a.Xr sh 1variable name, alphanumerics and underscores, and the first charactermay not be numeric..Sh AUTHORS.An Paul Traina Aq pst@FreeBSD.org.An Brian Somers Aq brian@Awfulhak.org
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -