xref: /freebsd/share/man/man5/periodic.conf.5 (revision 8fa113e5fc65fe6abc757f0089f477a87ee4d185)
1.\"-
2.\" Copyright (c) 2000 Brian Somers <brian@Awfulhak.org>
3.\" All rights reserved.
4.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
8.\" 1. Redistributions of source code must retain the above copyright
9.\"    notice, this list of conditions and the following disclaimer.
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.\" $FreeBSD$
27.\"
28.Dd June 22, 2000
29.Dt PERIODIC.CONF 5
30.Os
31.Sh NAME
32.Nm periodic.conf
33.Nd periodic job configuration information
34.Sh DESCRIPTION
35The file
36.Nm
37contains a description of how daily, weekly and montly system maintenance
38jobs should run.
39It resides in the
40.Pa /etc/defaults
41directory and parts may be overridden by a file of the same name in
42.Pa /etc ,
43which itself may be overridden by the
44.Pa /etc/periodic.conf.local
45file.
46.Pp
47.Nm
48is actually sourced as a shell script from each of the periodic scripts
49and is intended to simply provide default configuration variables.
50.Pp
51The following variables are used by
52.Xr periodic 8
53itself:
54.Bl -tag -offset 4n -width 2n
55.It Va local_periodic
56.Pq Vt str
57List of directories to search for periodic scripts.
58This list is always prefixed with
59.Pa /etc/periodic ,
60and is only used when an argument to
61.Xr periodic 8
62is not an absolute directory name.
63.It Va dir Ns No _output
64.Pq Vt path No or Vt list
65What to do with the output of the scripts envoked from
66the directory
67.Ar dir .
68If this variable is set to an absolute path name, output is logged to
69that file, otherwise it is taken as one or more space separated email
70addresses and mailed to those users.
71If this variable is not set or is empty, output is sent to standard output.
72.Pp
73For an unattended machine, suitable values for
74.Va daily_output ,
75.Va weekly_output ,
76and
77.Va monthly_output
78might be
79.Dq /var/log/daily.log ,
80.Dq /var/log/weekly.log ,
81and
82.Dq /var/log/monthly.log
83respectively, as
84.Xr newsyslog 8
85will rotate these files (if they exists) at the appropriate times.
86.It Va dir Ns No _show_success
87.It Va dir Ns No _show_info
88.It Va dir Ns No _show_badconfig
89.Pq Vt bool
90These variables control whether
91.Xr periodic 8
92will mask the output of the envoked scripts based on their return code
93(where
94.Ar dir
95is the base directory name in which each script resides).
96If the return code of a script is
97.Sq 0
98and
99.Va dir Ns No _show_success
100is set to
101.Dq NO ,
102.Xr periodic 8
103will mask the script's output.
104If the return code of a script is
105.Sq 1
106and
107.Va dir Ns No _show_info
108is set to
109.Dq NO ,
110.Xr periodic 8
111will mask the script's output.
112If the return code of a script is
113.Sq 2
114and
115.Va dir Ns No _show_badconfig
116is set to
117.Dq NO ,
118.Xr periodic 8
119will mask the script's output.
120If these variables are set to neither
121.Dq YES
122nor
123.Dq NO ,
124they default to
125.Dq YES ,
126.Dq YES
127and
128.Dq NO
129respectively.
130.Pp
131Refer to the
132.Xr periodic 8
133man page for how script return codes are interpreted.
134.El
135.Pp
136The following variables are used by the standard scripts that reside in
137.Pa /etc/periodic/daily :
138.Bl -tag -offset 4n -width 2n
139.It Va daily_clean_disks_enable
140.Pq Vt bool
141Set to
142.Dq YES
143if you want to remove all files matching
144.Va daily_clean_disks_files
145daily.
146.It Va daily_clean_disks_files
147.Pq Vt str
148Set to a list of file names to match.
149Wild cards are permitted.
150.It Va daily_clean_disks_days
151.Pq Vt num
152When
153.Va daily_clean_disks_enable
154is set to
155.Dq YES ,
156this must also be set to the number of days old that a file's access
157and modification times must be before it's deleted.
158.It Va daily_clean_disks_verbose
159.Pq Vt bool
160Set to
161.Dq YES
162if you want the removed files to be reported in your daily output.
163.It Va daily_clean_tmps_enable
164.Pq Vt bool
165Set to
166.Dq YES
167if you want to clear temporary directories daily.
168.It Va daily_clean_tmps_dirs
169.Pq Vt str
170Set to the list of directories to clear if
171.Va daily_clean_tmps_enable
172is set to
173.Dq YES .
174.It Va daily_clean_tmps_days
175.Pq Vt num
176When
177.Va daily_clean_tmps_enable
178is set, this must also be set to the number of days old that a file's access
179and modification times must be before it's deleted.
180.It Va daily_clean_tmps_ignore
181.Pq Vt str
182Set to the list of files that should not be deleted when
183.Va daily_clean_tmps_enable
184is set to
185.Dq YES .
186Wild card characters are permitted.
187.It Va daily_clean_tmps_verbose
188.Pq Vt bool
189Set to
190.Dq YES
191if you want the removed files to be reported in your daily output.
192.It Va daily_clean_preserve_enable
193.Pq Vt bool
194Set to
195.Dq YES
196if you wish to remove old files from
197.Pa /var/preserve .
198.It Va daily_clean_preserve_days
199.Pq Vt num
200Set to the number of days that files must not have been modified before
201they are deleted.
202.It Va daily_clean_preserve_verbose
203.Pq Vt bool
204Set to
205.Dq YES
206if you want the removed files to be reported in your daily output.
207.It Va daily_clean_msgs_enable
208.Pq Vt bool
209Set to
210.Dq YES
211if you wish old system messages to be purged.
212.It Va daily_clean_msgs_days
213.Pq Vt num
214Set to the number of days that files must not have been modified before
215they are deleted.
216If this variable is left blank, the
217.Xr msgs 1
218default is used.
219.It Va daily_clean_rwho_enable
220.Pq Vt bool
221Set to
222.Dq YES
223if you wish old files in
224.Pa /var/who
225to be purged.
226.It Va daily_clean_rwho_days
227.Pq Vt num
228Set to the number of days that files must not have been modified before
229they are deleted.
230.It Va daily_clean_rwho_verbose
231.Pq Vt bool
232Set to
233.Dq YES
234if you want the removed files to be reported in your daily output.
235.It Va daily_clean_hoststat_enable
236.Pq Vt bool
237Set to
238.Dq YES
239if you wish old files in
240.Pa /var/spool/.hoststat
241to be purged.
242.It Va daily_clean_hoststat_days
243.Pq Vt num
244Set to the number of days that files must not have been modified before
245they are deleted.
246.It Va daily_clean_hoststat_verbose
247.Pq Vt bool
248Set to
249.Dq YES
250if you want the removed files to be reported in your daily output.
251.It Va daily_backup_passwd_enable
252.Pq Vt bool
253Set to
254.Dq YES
255if you want the
256.Pa /etc/master.passwd
257and
258.Pa /etc/group
259files backed up and reported on.
260Reporting consists of checking both files for modifications and running
261.Xr chkgrp 8
262on the
263.Pa group
264file.
265.It Va daily_backup_aliases_enable
266.Pq Vt bool
267Set to
268.Dq YES
269if you want the
270.Pa /etc/mail/aliases
271file backed up and modifications to be displayed in your daily output.
272.It Va daily_backup_distfile_enable
273.Pq Vt bool
274Set to
275.Dq YES
276if you want the
277.Pa /etc/Distfile
278file backed up and modifications to be displayed in your daily output.
279.It Va daily_calendar_enable
280.Pq Vt bool
281Set to
282.Dq YES
283if you want to run
284.Ic calendar -a
285daily.
286.It Va daily_accounting_enable
287.Pq Vt bool
288Set to
289.Dq YES
290if you want to rotate your daily accounting files.
291No rotations are necessary unless
292.Va accounting_enable
293is enabled in
294.Xr rc.conf 5 .
295.It Va daily_accounting_compress
296.Pq Vt bool
297Set to
298.Dq YES
299if you want your daily accounting files to be compressed using
300.Xr gzip 1 .
301.It Va daily_accounting_save
302.Pq Vt num
303When
304.Va daily_accounting_enable
305is set, this may also be set to the number of daily accounting files that are
306to be saved.
307The default is
308.Dq 3 .
309.It Va daily_accounting_flags
310.Pq Vt str
311Set to the arguments to pass to the
312.Xr sa 8
313utility (in addition to
314.Fl s )
315when
316.Va daily_accounting_enable
317is set to
318.Dq YES .
319The default is
320.Fl q .
321.It Va daily_distfile_enable
322.Pq Vt bool
323Set to
324.Dq YES
325if you want to run
326.Xr rdist 1
327daily.
328The
329.Pa /etc/Distfile
330file must also exist.
331.It Pa daily_news_expire_enable
332.Pq Vt bool
333Set to
334.Dq YES
335if you want to run
336.Pa /etc/news.expire .
337.It Va daily_status_disks_enable
338.Pq Vt bool
339Set to
340.Dq YES
341if you want to run
342.Xr df 1
343(with the arguments supplied in
344.Va daily_status_disks_df_flags )
345and
346.Ic dump -W .
347.It Va daily_status_disks_df_flags
348.Pq Vt str
349Set to the arguments for the
350.Xr df 1
351utility when
352.Va daily_status_disks_enable
353is set to
354.Dq YES .
355.It Va daily_status_network_enable
356.Pq Vt bool
357Set to
358.Dq YES
359if you want to run
360.Ic netstat -i .
361.It Va daily_status_network_usedns
362.Pq Vt bool
363Set to
364.Dq YES
365if you want to run
366.Xr netstat 1
367without the
368.Fl n
369option (to do DNS lookups).
370.It Va daily_status_rwho_enable
371.Pq Vt bool
372Set to
373.Dq YES
374if you want to run
375.Xr uptime 1
376(or
377.Xr ruptime 1
378if
379.Va rwhod_enable
380is set to
381.Dq YES
382in
383.Pa /etc/rc.conf ) .
384.It Va daily_status_mailq_enable
385.Pq Vt bool
386Set to
387.Dq YES
388if you want to run
389.Xr mailq 1 .
390.It Va daily_status_mailq_shorten
391.Pq Vt bool
392Set to
393.Dq YES
394if you want to shorten the
395.Nm mailq
396output when
397.Va daily_status_mailq_enable
398is set to
399.Dq YES .
400.It Va daily_status_security_enable
401.Pq Vt bool
402Set to
403.Dq YES
404if you want to run
405.Pa /etc/security .
406.It Va daily_status_security_inline
407.Pq Vt bool
408Set to
409.Dq YES
410if you want to run
411.Pa /etc/security
412inline.
413The default is to either mail or log the output according to the value of
414.Va daily_status_security_output .
415.It Va daily_status_security_output
416.Pq Vt str
417Where to send the output of
418.Pa /etc/security
419if
420.Va daily_status_security_inline
421is set to
422.Dq NO .
423This variable behaves in the same way as the
424.Va *_output
425variables above, namely it can be set either to one or more email addresses
426or to an absolute file name.
427.It Va daily_status_security_noamd
428.Pq Vt bool
429Set to
430.Dq YES
431if you want to ignore
432.Xr amd 8
433mounts when comparing against yesterdays filesystem mounts.
434.It Va daily_status_mail_rejects_enable
435.Pq Vt bool
436Set to
437.Dq YES
438if you want to summarise mail rejections logged to
439.Pa /var/log/maillog
440for the previous day.
441.It Va daily_status_mail_rejects_logs
442.Pq Vt num
443Set to the number of maillog files that should be checked
444for yesterday's mail rejects.
445.It Va daily_status_named_enable
446.Pq Vt bool
447Set to
448.Dq YES
449if you want to summarise denied zone transfers (AXFR and IXFR)
450for the previious day.
451.It Va daily_status_named_usedns
452.Pq Vt bool
453Set to
454.Dq YES
455if you want to enable reverse DNS lookups.
456.It Va daily_queuerun_enable
457.Pq Vt bool
458Set to
459.Dq YES
460if you want to manually run the mail queue at least once a day.
461.It Va daily_local
462.Pq Vt str
463Set to a list of extra scripts that should be run after all other
464daily scripts.
465All scripts must be absolute path names.
466.El
467.Pp
468The following variables are used by the standard scripts that reside in
469.Pa /etc/periodic/weekly :
470.Bl -tag -offset 4n -width 2n
471.It Va weekly_clean_kvmdb_enable
472.Pq Vt bool
473Set to
474.Dq YES
475if you want to purge old
476.Pa /var/db/kvm_*.db
477files.
478The kvm file for the current kernel will not be purged.
479.It Va weekly_clean_kvmdb_days
480.Pq Vt num
481Set to the number of days that the file must not have been accessed
482before being deleted.
483.It Va weekly_clean_kvmdb_verbose
484.Pq Vt bool
485Set to
486.Dq YES
487if you want the removed files to be reported in your weekly output.
488.It Va weekly_locate_enable
489.Pq Vt bool
490Set to
491.Dq YES
492if you want to run
493.Pa /usr/libexec/locate.updatedb .
494This script is run using
495.Ic nice -5
496as user
497.An nobody ,
498and generates the table used by the
499.Xr locate 1
500command.
501.It Va weekly_whatis_enable
502.Pq Vt bool
503Set to
504.Dq YES
505if you want to run
506.Pa /usr/libexec/makewhatis.local .
507This script regenerates the database used by the
508.Xr apropos 1
509command.
510.It Va weekly_catman_enable
511.Pq Vt bool
512Set to
513.Dq YES
514if you want to run
515.Pa /usr/libexec/catman.local .
516This script processes all out of date man pages, speeding up the
517.Xr man 1
518command at the expense of disk space.
519.It Va weekly_noid_enable
520.Pq Vt bool
521Set to
522.Dq YES
523if you want to locate orphaned files on the system.
524An orphaned file is one with an invalid owner or group.
525.It Va weekly_noid_dirs
526.Pq Vt str
527A list of directories under which orphaned files are searched for.
528This would usually be set to
529.Pa / .
530.It Va weekly_status_pkg_enable
531.Pq Vt bool
532Set to
533.Dq YES
534if you want to use
535.Xr pkg_version 1
536to list installed packages which are out of date.
537.It Va weekly_local
538.Pq Vt str
539Set to a list of extra scripts that should be run after all other
540weekly scripts.
541All scripts must be absolute path names.
542.El
543.Pp
544The following variables are used by the standard scripts that reside in
545.Pa /etc/periodic/monthly :
546.Bl -tag -offset 4n -width 2n
547.It Va monthly_accounting_enable
548.Pq Vt bool
549Set to
550.Dq YES
551if you want to do login accounting using the
552.Xr ac 8
553command.
554.It Va monthly_local
555.Pq Vt str
556Set to a list of extra scripts that should be run after all other
557monthly scripts.
558All scripts must be absolute path names.
559.El
560.Sh FILES
561.Bl -tag -width /etc/defaults/periodic.conf
562.It Pa /etc/defaults/periodic.conf
563The default configuration file.
564This file contains all default variables and values.
565.It Pa /etc/periodic.conf
566The usual system specific variable override file.
567.It Pa /etc/periodic.conf.local
568An additional override file, useful when
569.Pa /etc/periodic.conf
570is shared or distributed.
571.El
572.Sh SEE ALSO
573.Xr apropos 1 ,
574.Xr calendar 1 ,
575.Xr df 1 ,
576.Xr gzip 1 ,
577.Xr locate 1 ,
578.Xr man 1 ,
579.Xr msgs 1 ,
580.Xr netstat 1 ,
581.Xr nice 1 ,
582.Xr pkg_version 1 ,
583.Xr rdist 1 ,
584.Xr rc.conf 5 ,
585.Xr ac 8 ,
586.Xr chkgrp 8 ,
587.Xr dump 8 ,
588.Xr newsyslog 8 ,
589.Xr periodic 8
590.Sh HISTORY
591The
592.Nm
593file appeared in
594.Fx 4.1 .
595.Sh AUTHORS
596.An Brian Somers Aq brian@Awfulhak.org .
597