xref: /freebsd/share/man/man5/periodic.conf.5 (revision 262e143bd46171a6415a5b28af260a5efa2a3db8)
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 November 24, 2004
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
133manual 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 is 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 is 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
239to run
240.Nm sendmail Fl bH
241to automatically purge stale entries from
242.Xr sendmail 8 Ns 's
243host status cache.
244Files will be deleted using the same criteria as
245.Xr sendmail 8
246would normally use when determining whether to believe the cached information,
247as configured in
248.Pa /etc/mail/sendmail.cf .
249.It Va daily_backup_passwd_enable
250.Pq Vt bool
251Set to
252.Dq YES
253if you want the
254.Pa /etc/master.passwd
255and
256.Pa /etc/group
257files backed up and reported on.
258Reporting consists of checking both files for modifications and running
259.Xr chkgrp 8
260on the
261.Pa group
262file.
263.It Va daily_backup_aliases_enable
264.Pq Vt bool
265Set to
266.Dq YES
267if you want the
268.Pa /etc/mail/aliases
269file backed up and modifications to be displayed in your daily output.
270.It Va daily_calendar_enable
271.Pq Vt bool
272Set to
273.Dq YES
274if you want to run
275.Nm calendar Fl a
276daily.
277.It Va daily_accounting_enable
278.Pq Vt bool
279Set to
280.Dq YES
281if you want to rotate your daily accounting files.
282No rotations are necessary unless
283.Va accounting_enable
284is enabled in
285.Xr rc.conf 5 .
286.It Va daily_accounting_compress
287.Pq Vt bool
288Set to
289.Dq YES
290if you want your daily accounting files to be compressed using
291.Xr gzip 1 .
292.It Va daily_accounting_save
293.Pq Vt num
294When
295.Va daily_accounting_enable
296is set, this may also be set to the number of daily accounting files that are
297to be saved.
298The default is
299.Dq 3 .
300.It Va daily_accounting_flags
301.Pq Vt str
302Set to the arguments to pass to the
303.Xr sa 8
304utility (in addition to
305.Fl s )
306when
307.Va daily_accounting_enable
308is set to
309.Dq YES .
310The default is
311.Fl q .
312.It Va daily_news_expire_enable
313.Pq Vt bool
314Set to
315.Dq YES
316if you want to run
317.Pa /etc/news.expire .
318.It Va daily_status_disks_enable
319.Pq Vt bool
320Set to
321.Dq YES
322if you want to run
323.Xr df 1
324(with the arguments supplied in
325.Va daily_status_disks_df_flags )
326and
327.Nm dump Fl W .
328.It Va daily_status_disks_df_flags
329.Pq Vt str
330Set to the arguments for the
331.Xr df 1
332utility when
333.Va daily_status_disks_enable
334is set to
335.Dq YES .
336.It Va daily_status_network_enable
337.Pq Vt bool
338Set to
339.Dq YES
340if you want to run
341.Nm netstat Fl i .
342.It Va daily_status_network_usedns
343.Pq Vt bool
344Set to
345.Dq YES
346if you want to run
347.Xr netstat 1
348without the
349.Fl n
350option (to do DNS lookups).
351.It Va daily_status_rwho_enable
352.Pq Vt bool
353Set to
354.Dq YES
355if you want to run
356.Xr uptime 1
357(or
358.Xr ruptime 1
359if
360.Va rwhod_enable
361is set to
362.Dq YES
363in
364.Pa /etc/rc.conf ) .
365.It Va daily_status_mailq_enable
366.Pq Vt bool
367Set to
368.Dq YES
369if you want to run
370.Xr mailq 1 .
371.It Va daily_status_mailq_shorten
372.Pq Vt bool
373Set to
374.Dq YES
375if you want to shorten the
376.Xr mailq 1
377output when
378.Va daily_status_mailq_enable
379is set to
380.Dq YES .
381.It Va daily_status_include_submit_mailq
382.Pq Vt bool
383Set to
384.Dq YES
385if you also want to run
386.Xr mailq 1
387on the submit mail queue when
388.Va daily_status_mailq_enable
389is set to
390.Dq YES .
391This may not work with MTAs other than
392.Xr sendmail 8 .
393.It Va daily_status_security_enable
394.Pq Vt bool
395Set to
396.Dq YES
397if you want to run the security check.
398The security check is another set of
399.Xr periodic 8
400scripts.
401The system defaults are in
402.Pa /etc/periodic/security .
403Local scripts should be placed in
404.Pa /usr/local/etc/periodic/security .
405See the
406.Xr periodic 8
407manual page for more information.
408.It Va daily_status_security_inline
409.Pq Vt bool
410Set to
411.Dq YES
412if you want the security check output inline.
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 the security check if
418.Va daily_status_security_inline
419is set to
420.Dq NO .
421This variable behaves in the same way as the
422.Va *_output
423variables above, namely it can be set either to one or more email addresses
424or to an absolute file name.
425.It Va daily_status_security_diff_flags
426.Pq Vt str
427Set to the arguments to pass to the
428.Xr diff 1
429utility when generating differences.
430The default is
431.Fl b u .
432.It Va daily_status_security_chksetuid_enable
433.Pq Vt bool
434Set to
435.Dq YES
436to compare the modes and modification times of setuid executables with
437the previous day's values.
438.It Va daily_status_security_chkmounts_enable
439.Pq Vt bool
440Set to
441.Dq YES
442to check for changes mounted file systems to the previous day's values.
443.It Va daily_status_security_noamd
444.Pq Vt bool
445Set to
446.Dq YES
447if you want to ignore
448.Xr amd 8
449mounts when comparing against yesterday's file system mounts in the
450.Va daily_status_security_chkmounts_enable
451check.
452.It Va daily_status_security_chkuid0_enable
453.Pq Vt bool
454Set to
455.Dq YES
456to check
457.Pa /etc/master.passwd
458for accounts with uid 0.
459.It Va daily_status_security_passwdless_enable
460.Pq Vt bool
461Set to
462.Dq YES
463to check
464.Pa /etc/master.passwd
465for accounts with empty passwords.
466.It Va daily_status_security_ipfwdenied_enable
467.Pq Vt bool
468Set to
469.Dq YES
470to show log entries for packets denied by
471.Xr ipfw 8
472since yesterday's check.
473.It Va daily_status_security_ipfdenied_enable
474.Pq Vt bool
475Set to
476.Dq YES
477to show log entries for packets denied by
478.Xr ipf 8
479since yesterday's check.
480.It Va daily_status_security_pfdenied_enable
481.Pq Vt bool
482Set to
483.Dq YES
484to show log entries for packets denied by
485.Xr pf 4
486since yesterday's check.
487.It Va daily_status_security_ipfwlimit_enable
488.Pq Vt bool
489Set to
490.Dq YES
491to display
492.Xr ipfw 8
493rules that have reached their verbosity limit.
494.It Va daily_status_security_ip6fwdenied_enable
495.Pq Vt bool
496Set to
497.Dq YES
498to show log entries for packets denied by
499.Xr ip6fw 8
500since yesterday's check.
501.It Va daily_status_security_ip6fwlimit_enable
502.Pq Vt bool
503Set to
504.Dq YES
505to display
506.Xr ip6fw 8
507rules that have reached their verbosity limit.
508.It Va daily_status_security_kernelmsg_enable
509.Pq Vt bool
510Set to
511.Dq YES
512to show new
513.Xr dmesg 8
514entries since yesterday's check.
515.It Va daily_status_security_loginfail_enable
516.Pq Vt bool
517Set to
518.Dq YES
519to display failed logins from
520.Pa /var/log/messages
521in the previous day.
522.It Va daily_status_security_tcpwrap_enable
523.Pq Vt bool
524Set to
525.Dq YES
526to display connections denied by tcpwrappers (see
527.Xr hosts_access 5 )
528from
529.Pa /var/log/messages
530during the previous day.
531.It Va daily_status_mail_rejects_enable
532.Pq Vt bool
533Set to
534.Dq YES
535if you want to summarise mail rejections logged to
536.Pa /var/log/maillog
537for the previous day.
538.It Va daily_status_mail_rejects_logs
539.Pq Vt num
540Set to the number of maillog files that should be checked
541for yesterday's mail rejects.
542.It Va daily_status_named_enable
543.Pq Vt bool
544Set to
545.Dq YES
546if you want to summarise denied zone transfers (AXFR and IXFR)
547for the previous day.
548.It Va daily_status_named_usedns
549.Pq Vt bool
550Set to
551.Dq YES
552if you want to enable reverse DNS lookups.
553.It Va daily_queuerun_enable
554.Pq Vt bool
555Set to
556.Dq YES
557if you want to manually run the mail queue at least once a day.
558.It Va daily_submit_queuerun
559.Pq Vt bool
560Set to
561.Dq YES
562if you also want to manually run the submit mail queue at least once a day
563when
564.Va daily_queuerun_enable
565is set to
566.Dq YES .
567.It Va daily_local
568.Pq Vt str
569Set to a list of extra scripts that should be run after all other
570daily scripts.
571All scripts must be absolute path names.
572.El
573.Pp
574The following variables are used by the standard scripts that reside in
575.Pa /etc/periodic/weekly :
576.Bl -tag -offset 4n -width 2n
577.It Va weekly_clean_kvmdb_enable
578.Pq Vt bool
579Set to
580.Dq YES
581if you want to purge old
582.Pa /var/db/kvm_*.db
583files.
584The kvm file for the current kernel will not be purged.
585.It Va weekly_clean_kvmdb_days
586.Pq Vt num
587Set to the number of days that the file must not have been accessed
588before being deleted.
589.It Va weekly_clean_kvmdb_verbose
590.Pq Vt bool
591Set to
592.Dq YES
593if you want the removed files to be reported in your weekly output.
594.It Va weekly_locate_enable
595.Pq Vt bool
596Set to
597.Dq YES
598if you want to run
599.Pa /usr/libexec/locate.updatedb .
600This script is run using
601.Nm nice Fl 5
602as user
603.An nobody ,
604and generates the table used by the
605.Xr locate 1
606command.
607.It Va weekly_whatis_enable
608.Pq Vt bool
609Set to
610.Dq YES
611if you want to run
612.Pa /usr/libexec/makewhatis.local .
613This script regenerates the database used by the
614.Xr apropos 1
615command.
616.It Va weekly_catman_enable
617.Pq Vt bool
618Set to
619.Dq YES
620if you want to run
621.Pa /usr/libexec/catman.local .
622This script processes all out of date manual pages, speeding up the
623.Xr man 1
624command at the expense of disk space.
625.It Va weekly_noid_enable
626.Pq Vt bool
627Set to
628.Dq YES
629if you want to locate orphaned files on the system.
630An orphaned file is one with an invalid owner or group.
631.It Va weekly_noid_dirs
632.Pq Vt str
633A list of directories under which orphaned files are searched for.
634This would usually be set to
635.Pa / .
636.It Va weekly_status_pkg_enable
637.Pq Vt bool
638Set to
639.Dq YES
640if you want to use
641.Xr pkg_version 1
642to list installed packages which are out of date.
643.It Va pkg_version
644.Pq Vt string
645When
646.Va weekly_status_pkg_enable
647is set to
648.Dq YES ,
649this variable specifies the program that is used to determine the out of
650date packages.
651If unset, the
652.Xr pkg_version 1
653program is used.
654As an example, this variable might be set to
655.Dq portversion
656if the portupgrade port has been installed.
657.It Va pkg_version_index
658.Pq Vt string
659This variable specifies the
660.Pa INDEX
661file from
662.Pa /usr/ports
663that should be used by
664.Xr pkg_version 1 .
665Because the dependency tree may be substantially different between versions of
666.Fx ,
667there may be more than one
668.Pa INDEX
669file in
670.Pa /usr/ports .
671.Pp
672Note, if the
673.Va pkg_version
674variable is set to
675.Dq Li portversion ,
676it will also be necessary to arrange that the correct
677.Pa INDEX
678file is specified
679using environment variables and that
680.Va pkg_version_index
681is cleared in
682.Pa /etc/periodic.conf
683.Pq Dq Li pkg_version_index= .
684.It Va weekly_local
685.Pq Vt str
686Set to a list of extra scripts that should be run after all other
687weekly scripts.
688All scripts must be absolute path names.
689.El
690.Pp
691The following variables are used by the standard scripts that reside in
692.Pa /etc/periodic/monthly :
693.Bl -tag -offset 4n -width 2n
694.It Va monthly_accounting_enable
695.Pq Vt bool
696Set to
697.Dq YES
698if you want to do login accounting using the
699.Xr ac 8
700command.
701.It Va monthly_local
702.Pq Vt str
703Set to a list of extra scripts that should be run after all other
704monthly scripts.
705All scripts must be absolute path names.
706.El
707.Sh FILES
708.Bl -tag -width /etc/defaults/periodic.conf
709.It Pa /etc/defaults/periodic.conf
710The default configuration file.
711This file contains all default variables and values.
712.It Pa /etc/periodic.conf
713The usual system specific variable override file.
714.It Pa /etc/periodic.conf.local
715An additional override file, useful when
716.Pa /etc/periodic.conf
717is shared or distributed.
718.El
719.Sh SEE ALSO
720.Xr apropos 1 ,
721.Xr calendar 1 ,
722.Xr df 1 ,
723.Xr diff 1 ,
724.Xr gzip 1 ,
725.Xr locate 1 ,
726.Xr man 1 ,
727.Xr msgs 1 ,
728.Xr netstat 1 ,
729.Xr nice 1 ,
730.Xr pkg_version 1 ,
731.Xr rc.conf 5 ,
732.Xr ac 8 ,
733.Xr chkgrp 8 ,
734.Xr dump 8 ,
735.Xr newsyslog 8 ,
736.Xr periodic 8 ,
737.Xr sendmail 8
738.Sh HISTORY
739The
740.Nm
741file appeared in
742.Fx 4.1 .
743.Sh AUTHORS
744.An Brian Somers Aq brian@Awfulhak.org .
745