xref: /freebsd/share/man/man5/periodic.conf.5 (revision b52b9d56d4e96089873a75f9e29062eec19fabba)
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 monthly 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 executed 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 executed 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 Va 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_include_submit_mailq
401.Pq Vt bool
402Set to
403.Dq YES
404if you also want to run
405.Xr mailq 1
406on the submit mail queue when
407.Va daily_status_mailq_enable
408is set to
409.Dq YES .
410.It Va daily_status_security_enable
411.Pq Vt bool
412Set to
413.Dq YES
414if you want to run the security check.
415The security check is another set of
416.Xr periodic 8
417scripts.
418The system defaults are in
419.Pa /etc/periodic/security .
420Local scripts should be placed in
421.Pa /usr/local/etc/periodic/security .
422See the
423.Xr periodic 8
424manual page for more information.
425.It Va daily_status_security_inline
426.Pq Vt bool
427Set to
428.Dq YES
429if you want the security check output inline.
430The default is to either mail or log the output according to the value of
431.Va daily_status_security_output .
432.It Va daily_status_security_output
433.Pq Vt str
434Where to send the output of the security check if
435.Va daily_status_security_inline
436is set to
437.Dq NO .
438This variable behaves in the same way as the
439.Va *_output
440variables above, namely it can be set either to one or more email addresses
441or to an absolute file name.
442.It Va daily_status_security_chksetuid_enable
443.Pq Vt bool
444Set to
445.Dq YES
446to compare the modes and modification times of setuid executables with
447the previous day's values.
448.It Va daily_status_security_chkmounts_enable
449.Pq Vt bool
450Set to
451.Dq YES
452to check for changes mounted filesystems to the previous day's values.
453.It Va daily_status_security_noamd
454.Pq Vt bool
455Set to
456.Dq YES
457if you want to ignore
458.Xr amd 8
459mounts when comparing against yesterdays filesystem mounts in the
460.Va daily_status_security_chkmounts_enable
461check.
462.It Va daily_status_security_chkuid0_enable
463.Pq Vt bool
464Set to
465.Dq YES
466to check
467.Pa /etc/master.passwd
468for accounts with uid 0.
469.It Va daily_status_security_passwdless_enable
470.Pq Vt bool
471Set to
472.Dq YES
473to check
474.Pa /etc/master.passwd
475for accounts with empty passwords.
476.It Va daily_status_security_ipfwdenied_enable
477.Pq Vt bool
478Set to
479.Dq YES
480to show log entries for packets denied by
481.Xr ipfw 8
482since yesterday's check.
483.It Va daily_status_security_ipfwlimit_enable
484.Pq Vt bool
485Set to
486.Dq YES
487to display
488.Xr ipfw 8
489rules that have reached their verbosity limit.
490.It Va daily_status_security_ip6fwdenied_enable
491.Pq Vt bool
492Set to
493.Dq YES
494to show log entries for packets denied by
495.Xr ip6fw 8
496since yesterday's check.
497.It Va daily_status_security_ip6fwlimit_enable
498.Pq Vt bool
499Set to
500.Dq YES
501to display
502.Xr ip6fw 8
503rules that have reached their verbosity limit.
504.It Va daily_status_security_kernelmsg_enable
505.Pq Vt bool
506Set to
507.Dq YES
508to show new
509.Xr dmesg 8
510entries since yesterday's check.
511.It Va daily_status_security_loginfail_enable
512.Pq Vt bool
513Set to
514.Dq YES
515to display failed logins from
516.Pa /var/log/messages
517in the previous day.
518.It Va daily_status_security_tcpwrap_enable
519.Pq Vt bool
520Set to
521.Dq YES
522to display connections denied by tcpwrappers (see
523.Xr hosts_access 5 )
524from
525.Pa /var/log/messages
526during the previous day.
527.It Va daily_status_mail_rejects_enable
528.Pq Vt bool
529Set to
530.Dq YES
531if you want to summarise mail rejections logged to
532.Pa /var/log/maillog
533for the previous day.
534.It Va daily_status_mail_rejects_logs
535.Pq Vt num
536Set to the number of maillog files that should be checked
537for yesterday's mail rejects.
538.It Va daily_status_named_enable
539.Pq Vt bool
540Set to
541.Dq YES
542if you want to summarise denied zone transfers (AXFR and IXFR)
543for the previous day.
544.It Va daily_status_named_usedns
545.Pq Vt bool
546Set to
547.Dq YES
548if you want to enable reverse DNS lookups.
549.It Va daily_queuerun_enable
550.Pq Vt bool
551Set to
552.Dq YES
553if you want to manually run the mail queue at least once a day.
554.It Va daily_submit_queuerun
555.Pq Vt bool
556Set to
557.Dq YES
558if you also want to manually run the submit mail queue at least once a day
559when
560.Va daily_queuerun_enable
561is set to
562.Dq YES .
563.It Va daily_local
564.Pq Vt str
565Set to a list of extra scripts that should be run after all other
566daily scripts.
567All scripts must be absolute path names.
568.El
569.Pp
570The following variables are used by the standard scripts that reside in
571.Pa /etc/periodic/weekly :
572.Bl -tag -offset 4n -width 2n
573.It Va weekly_clean_kvmdb_enable
574.Pq Vt bool
575Set to
576.Dq YES
577if you want to purge old
578.Pa /var/db/kvm_*.db
579files.
580The kvm file for the current kernel will not be purged.
581.It Va weekly_clean_kvmdb_days
582.Pq Vt num
583Set to the number of days that the file must not have been accessed
584before being deleted.
585.It Va weekly_clean_kvmdb_verbose
586.Pq Vt bool
587Set to
588.Dq YES
589if you want the removed files to be reported in your weekly output.
590.It Va weekly_locate_enable
591.Pq Vt bool
592Set to
593.Dq YES
594if you want to run
595.Pa /usr/libexec/locate.updatedb .
596This script is run using
597.Ic nice -5
598as user
599.An nobody ,
600and generates the table used by the
601.Xr locate 1
602command.
603.It Va weekly_whatis_enable
604.Pq Vt bool
605Set to
606.Dq YES
607if you want to run
608.Pa /usr/libexec/makewhatis.local .
609This script regenerates the database used by the
610.Xr apropos 1
611command.
612.It Va weekly_catman_enable
613.Pq Vt bool
614Set to
615.Dq YES
616if you want to run
617.Pa /usr/libexec/catman.local .
618This script processes all out of date man pages, speeding up the
619.Xr man 1
620command at the expense of disk space.
621.It Va weekly_noid_enable
622.Pq Vt bool
623Set to
624.Dq YES
625if you want to locate orphaned files on the system.
626An orphaned file is one with an invalid owner or group.
627.It Va weekly_noid_dirs
628.Pq Vt str
629A list of directories under which orphaned files are searched for.
630This would usually be set to
631.Pa / .
632.It Va weekly_status_pkg_enable
633.Pq Vt bool
634Set to
635.Dq YES
636if you want to use
637.Xr pkg_version 1
638to list installed packages which are out of date.
639.It Va weekly_local
640.Pq Vt str
641Set to a list of extra scripts that should be run after all other
642weekly scripts.
643All scripts must be absolute path names.
644.El
645.Pp
646The following variables are used by the standard scripts that reside in
647.Pa /etc/periodic/monthly :
648.Bl -tag -offset 4n -width 2n
649.It Va monthly_accounting_enable
650.Pq Vt bool
651Set to
652.Dq YES
653if you want to do login accounting using the
654.Xr ac 8
655command.
656.It Va monthly_local
657.Pq Vt str
658Set to a list of extra scripts that should be run after all other
659monthly scripts.
660All scripts must be absolute path names.
661.El
662.Sh FILES
663.Bl -tag -width /etc/defaults/periodic.conf
664.It Pa /etc/defaults/periodic.conf
665The default configuration file.
666This file contains all default variables and values.
667.It Pa /etc/periodic.conf
668The usual system specific variable override file.
669.It Pa /etc/periodic.conf.local
670An additional override file, useful when
671.Pa /etc/periodic.conf
672is shared or distributed.
673.El
674.Sh SEE ALSO
675.Xr apropos 1 ,
676.Xr calendar 1 ,
677.Xr df 1 ,
678.Xr gzip 1 ,
679.Xr locate 1 ,
680.Xr man 1 ,
681.Xr msgs 1 ,
682.Xr netstat 1 ,
683.Xr nice 1 ,
684.Xr pkg_version 1 ,
685.Xr rdist 1 ,
686.Xr rc.conf 5 ,
687.Xr ac 8 ,
688.Xr chkgrp 8 ,
689.Xr dump 8 ,
690.Xr newsyslog 8 ,
691.Xr periodic 8
692.Sh HISTORY
693The
694.Nm
695file appeared in
696.Fx 4.1 .
697.Sh AUTHORS
698.An Brian Somers Aq brian@Awfulhak.org .
699