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