periodic.conf revision 277216
161981Sbrian#!/bin/sh
261981Sbrian#
361981Sbrian# This is defaults/periodic.conf - a file full of useful variables that
461981Sbrian# you can set to change the default behaviour of periodic jobs on your
561981Sbrian# system.  You should not edit this file!  Put any overrides into one of the
661981Sbrian# $periodic_conf_files instead and you will be able to update these defaults
761981Sbrian# later without spamming your local configuration information.
861981Sbrian#
961981Sbrian# The $periodic_conf_files files should only contain values which override
1061981Sbrian# values set in this file.  This eases the upgrade path when defaults
1161981Sbrian# are changed and new features are added.
1261981Sbrian#
13140771Skeramida# For a more detailed explanation of all the periodic.conf variables, please
14140771Skeramida# refer to the periodic.conf(5) manual page.
15140771Skeramida#
1661981Sbrian# $FreeBSD: head/etc/defaults/periodic.conf 277216 2015-01-15 19:52:19Z gjb $
1761981Sbrian#
1861981Sbrian
1961981Sbrian# What files override these defaults ?
2061981Sbrianperiodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local"
2161981Sbrian
2261981Sbrian# periodic script dirs
23170085Sdougblocal_periodic="/usr/local/etc/periodic"
2461981Sbrian
2561981Sbrian
2661981Sbrian# Daily options
2761981Sbrian
2865843Sbrian# These options are used by periodic(8) itself to determine what to do
2965843Sbrian# with the output of the sub-programs that are run, and where to send
3065843Sbrian# that output.  $daily_output might be set to /var/log/daily.log if you
3165843Sbrian# wish to log the daily output and have the files rotated by newsyslog(8)
3265843Sbrian#
3365843Sbriandaily_output="root"					# user or /file
3465843Sbriandaily_show_success="YES"				# scripts returning 0
3565843Sbriandaily_show_info="YES"					# scripts returning 1
3665843Sbriandaily_show_badconfig="NO"				# scripts returning 2
3765843Sbrian
3861981Sbrian# 100.clean-disks
3961981Sbriandaily_clean_disks_enable="NO"				# Delete files daily
4061981Sbriandaily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*"
4161981Sbriandaily_clean_disks_days=3				# If older than this
4261981Sbriandaily_clean_disks_verbose="YES"				# Mention files deleted
4361981Sbrian
4461981Sbrian# 110.clean-tmps
4561981Sbriandaily_clean_tmps_enable="NO"				# Delete stuff daily
4661981Sbriandaily_clean_tmps_dirs="/tmp"				# Delete under here
4761981Sbriandaily_clean_tmps_days="3"				# If not accessed for
48174028Sjhbdaily_clean_tmps_ignore=".X*-lock .X11-unix .ICE-unix .font-unix .XIM-unix"
49205509Sjoergdaily_clean_tmps_ignore="$daily_clean_tmps_ignore quota.user quota.group .snap"
50236284Seadlerdaily_clean_tmps_ignore="$daily_clean_tmps_ignore .sujournal"
51174028Sjhb							# Don't delete these
5261981Sbriandaily_clean_tmps_verbose="YES"				# Mention files deleted
5361981Sbrian
5461981Sbrian# 120.clean-preserve
5561981Sbriandaily_clean_preserve_enable="YES"			# Delete files daily
5661981Sbriandaily_clean_preserve_days=7				# If not modified for
5761981Sbriandaily_clean_preserve_verbose="YES"			# Mention files deleted
5861981Sbrian
5961981Sbrian# 130.clean-msgs
6061981Sbriandaily_clean_msgs_enable="YES"				# Delete msgs daily
6161981Sbriandaily_clean_msgs_days=					# If not modified for
6261981Sbrian
6361981Sbrian# 140.clean-rwho
6461981Sbriandaily_clean_rwho_enable="YES"				# Delete rwho daily
6561981Sbriandaily_clean_rwho_days=7					# If not modified for
6661981Sbriandaily_clean_rwho_verbose="YES"				# Mention files deleted
6761981Sbrian
6861981Sbrian# 150.clean-hoststat
69108959Swollmandaily_clean_hoststat_enable="YES"			# Purge sendmail host
70108959Swollman							# status cache daily
7161981Sbrian
7261981Sbrian# 200.backup-passwd
7361981Sbriandaily_backup_passwd_enable="YES"			# Backup passwd & group
7461981Sbrian
7561981Sbrian# 210.backup-aliases
7661981Sbriandaily_backup_aliases_enable="YES"			# Backup mail aliases
7761981Sbrian
7861981Sbrian# 300.calendar
7961981Sbriandaily_calendar_enable="NO"				# Run calendar -a
8061981Sbrian
8161981Sbrian# 310.accounting
8261981Sbriandaily_accounting_enable="YES"				# Rotate acct files
8362054Sbriandaily_accounting_compress="NO"				# Gzip rotated files
8477496Sbriandaily_accounting_flags=-q				# Flags to /usr/sbin/sa
8577492Sbriandaily_accounting_save=3					# How many files to save
8661981Sbrian
8761981Sbrian# 330.news
8861981Sbriandaily_news_expire_enable="YES"				# Run news.expire
8961981Sbrian
9061981Sbrian# 400.status-disks
9161981Sbriandaily_status_disks_enable="YES"				# Check disk status
92155060Smatteodaily_status_disks_df_flags="-l -h"		# df(1) flags for check
9361981Sbrian
94249095Smav# 401.status-graid
95249095Smavdaily_status_graid_enable="NO"				# Check graid(8)
96249095Smav
97168412Spjd# 404.status-zfs
98168412Spjddaily_status_zfs_enable="NO"				# Check ZFS
99231171Sgjbdaily_status_zfs_zpool_list_enable="YES"		# List ZFS pools
100168412Spjd
101154304Swollman# 406.status-gmirror
102154304Swollmandaily_status_gmirror_enable="NO"			# Check gmirror(8)
103154304Swollman
104156216Sbrueffer# 407.status-graid3
105156216Sbruefferdaily_status_graid3_enable="NO" 			# Check graid3(8)
106156216Sbrueffer
107156216Sbrueffer# 408.status-gstripe
108156216Sbruefferdaily_status_gstripe_enable="NO"			# Check gstripe(8)
109156216Sbrueffer
110156216Sbrueffer# 409.status-gconcat
111156216Sbruefferdaily_status_gconcat_enable="NO"			# Check gconcat(8)
112156216Sbrueffer
11361981Sbrian# 420.status-network
11461981Sbriandaily_status_network_enable="YES"			# Check network status
11561981Sbriandaily_status_network_usedns="YES"			# DNS lookups are ok
11661981Sbrian
11761981Sbrian# 430.status-rwho
11861981Sbriandaily_status_rwho_enable="YES"				# Check system status
11961981Sbrian
12061981Sbrian# 440.status-mailq
12161981Sbriandaily_status_mailq_enable="YES"				# Check mail status
12261981Sbriandaily_status_mailq_shorten="NO"				# Shorten output
12394342Sgshapirodaily_status_include_submit_mailq="YES"			# Also submit queue
12461981Sbrian
12561981Sbrian# 450.status-security
12661981Sbriandaily_status_security_enable="YES"			# Security check
127254974Sjlh# See also "Security options" below for more options
128254974Sjlhdaily_status_security_inline="NO"			# Run inline ?
129254974Sjlhdaily_status_security_output="root"			# user or /file
13061981Sbrian
13161981Sbrian# 460.status-mail-rejects
13261981Sbriandaily_status_mail_rejects_enable="YES"			# Check mail rejects
13362274Sbriandaily_status_mail_rejects_logs=3			# How many logs to check
134175153Sddsdaily_status_mail_rejects_shorten="NO"			# Shorten output
13561981Sbrian
136169517Smaxim# 480.status-ntpd
137169517Smaximdaily_status_ntpd_enable="NO"				# Check NTP status
138169517Smaxim
13972677Speter# 500.queuerun
14072677Speterdaily_queuerun_enable="YES"				# Run mail queue
14194342Sgshapirodaily_submit_queuerun="YES"				# Also submit queue
14272677Speter
143277216Sgjb# 510.status-world-kernel
144277216Sgjbdaily_status_world_kernel="YES"				# Check the running
145277216Sgjb							# userland/kernel version
146277216Sgjb
147226471Sse# 800.scrub-zfs
148226471Ssedaily_scrub_zfs_enable="NO"
149226471Ssedaily_scrub_zfs_pools=""			# empty string selects all pools
150226865Sdelphijdaily_scrub_zfs_default_threshold="35"		# days between scrubs
151226865Sdelphij#daily_scrub_zfs_${poolname}_threshold="35"	# pool specific threshold
152226471Sse
15361981Sbrian# 999.local
15461981Sbriandaily_local="/etc/daily.local"				# Local scripts
15561981Sbrian
15661981Sbrian
157255169Sjlh# Weekly options
158255169Sjlh
159255169Sjlh# These options are used by periodic(8) itself to determine what to do
160255169Sjlh# with the output of the sub-programs that are run, and where to send
161255169Sjlh# that output.  $weekly_output might be set to /var/log/weekly.log if you
162255169Sjlh# wish to log the weekly output and have the files rotated by newsyslog(8)
163255169Sjlh#
164255169Sjlhweekly_output="root"					# user or /file
165255169Sjlhweekly_show_success="YES"				# scripts returning 0
166255169Sjlhweekly_show_info="YES"					# scripts returning 1
167255169Sjlhweekly_show_badconfig="NO"				# scripts returning 2
168255169Sjlh
169255169Sjlh# 310.locate
170255169Sjlhweekly_locate_enable="YES"				# Update locate weekly
171255169Sjlh
172255169Sjlh# 320.whatis
173255169Sjlhweekly_whatis_enable="YES"				# Update whatis weekly
174255169Sjlh
175255169Sjlh# 330.catman
176255169Sjlhweekly_catman_enable="NO"				# Preformat man pages
177255169Sjlh
178255169Sjlh# 340.noid
179255169Sjlhweekly_noid_enable="NO"					# Find unowned files
180255169Sjlhweekly_noid_dirs="/"					# Look here
181255169Sjlh
182255169Sjlh# 450.status-security
183255169Sjlhweekly_status_security_enable="YES"			# Security check
184255169Sjlh# See also "Security options" above for more options
185255169Sjlhweekly_status_security_inline="NO"			# Run inline ?
186255169Sjlhweekly_status_security_output="root"			# user or /file
187255169Sjlh
188255169Sjlh# 999.local
189255169Sjlhweekly_local="/etc/weekly.local"			# Local scripts
190255169Sjlh
191255169Sjlh
192255169Sjlh# Monthly options
193255169Sjlh
194255169Sjlh# These options are used by periodic(8) itself to determine what to do
195255169Sjlh# with the output of the sub-programs that are run, and where to send
196255169Sjlh# that output.  $monthly_output might be set to /var/log/monthly.log if you
197255169Sjlh# wish to log the monthly output and have the files rotated by newsyslog(8)
198255169Sjlh#
199255169Sjlhmonthly_output="root"					# user or /file
200255169Sjlhmonthly_show_success="YES"				# scripts returning 0
201255169Sjlhmonthly_show_info="YES"					# scripts returning 1
202255169Sjlhmonthly_show_badconfig="NO"				# scripts returning 2
203255169Sjlh
204255169Sjlh# 200.accounting
205255169Sjlhmonthly_accounting_enable="YES"				# Login accounting
206255169Sjlh
207255169Sjlh# 450.status-security
208255169Sjlhmonthly_status_security_enable="YES"			# Security check
209255169Sjlh# See also "Security options" above for more options
210255169Sjlhmonthly_status_security_inline="NO"			# Run inline ?
211255169Sjlhmonthly_status_security_output="root"			# user or /file
212255169Sjlh
213255169Sjlh# 999.local
214255169Sjlhmonthly_local="/etc/monthly.local"			# Local scripts
215255169Sjlh
216255169Sjlh
21787514Scjc# Security options
21887514Scjc
219101607Sfanf# These options are used by the security periodic(8) scripts spawned in
220254974Sjlh# daily and weekly 450.status-security.
221254974Sjlhsecurity_status_logdir="/var/log"			# Directory for logs
222254974Sjlhsecurity_status_diff_flags="-b -u"			# flags for diff output
22387514Scjc
224255169Sjlh# Each of the security_status_*_period options below can have one of the
225254974Sjlh# following values:
226255169Sjlh# - NO: do not run at all
227254974Sjlh# - daily: only run during the daily security status
228254974Sjlh# - weekly: only run during the weekly security status
229255169Sjlh# - monthly: only run during the monthly security status
230255169Sjlh# Note that if periodic security scripts are run from crontab(5) directly,
231255169Sjlh# they will be run unless _enable or _period is set to "NO".
232254974Sjlh
23387514Scjc# 100.chksetuid
234254974Sjlhsecurity_status_chksetuid_enable="YES"
235254974Sjlhsecurity_status_chksetuid_period="daily"
23687514Scjc
237215213Sbrooks# 110.neggrpperm
238254974Sjlhsecurity_status_neggrpperm_enable="YES"
239254974Sjlhsecurity_status_neggrpperm_period="daily"
240215213Sbrooks
24187514Scjc# 200.chkmounts
242254974Sjlhsecurity_status_chkmounts_enable="YES"
243254974Sjlhsecurity_status_chkmounts_period="daily"
244254974Sjlh#security_status_chkmounts_ignore="^amd:"		# Don't check matching
24587514Scjc							# FS types
246254974Sjlhsecurity_status_noamd="NO"				# Don't check amd mounts
24787514Scjc
24887514Scjc# 300.chkuid0
249254974Sjlhsecurity_status_chkuid0_enable="YES"
250254974Sjlhsecurity_status_chkuid0_period="daily"
25187514Scjc
25287514Scjc# 400.passwdless
253254974Sjlhsecurity_status_passwdless_enable="YES"
254254974Sjlhsecurity_status_passwdless_period="daily"
25587514Scjc
256161602Strhodes# 410.logincheck
257254974Sjlhsecurity_status_logincheck_enable="YES"
258254974Sjlhsecurity_status_logincheck_period="daily"
259161602Strhodes
26087514Scjc# 500.ipfwdenied
261254974Sjlhsecurity_status_ipfwdenied_enable="YES"
262254974Sjlhsecurity_status_ipfwdenied_period="daily"
26387514Scjc
264105937Sthomas# 510.ipfdenied
265254974Sjlhsecurity_status_ipfdenied_enable="YES"
266254974Sjlhsecurity_status_ipfdenied_period="daily"
267105937Sthomas
268138061Smlaier# 520.pfdenied
269254974Sjlhsecurity_status_pfdenied_enable="YES"
270254974Sjlhsecurity_status_pfdenied_period="daily"
271138061Smlaier
27287514Scjc# 550.ipfwlimit
273254974Sjlhsecurity_status_ipfwlimit_enable="YES"
274254974Sjlhsecurity_status_ipfwlimit_period="daily"
27587514Scjc
276128473Sdarrenr# 610.ipf6denied
277254974Sjlhsecurity_status_ipf6denied_enable="YES"
278254974Sjlhsecurity_status_ipf6denied_period="daily"
279128473Sdarrenr
28087514Scjc# 700.kernelmsg
281254974Sjlhsecurity_status_kernelmsg_enable="YES"
282254974Sjlhsecurity_status_kernelmsg_period="daily"
28387514Scjc
28487514Scjc# 800.loginfail
285254974Sjlhsecurity_status_loginfail_enable="YES"
286254974Sjlhsecurity_status_loginfail_period="daily"
28787514Scjc
28887514Scjc# 900.tcpwrap
289254974Sjlhsecurity_status_tcpwrap_enable="YES"
290254974Sjlhsecurity_status_tcpwrap_period="daily"
29187514Scjc
29287514Scjc
29361981Sbrian
29461981Sbrian# Define source_periodic_confs, the mechanism used by /etc/periodic/*/*
29561981Sbrian# scripts to source defaults/periodic.conf overrides safely.
29661981Sbrian
29761981Sbrianif [ -z "${source_periodic_confs_defined}" ]; then
29861981Sbrian        source_periodic_confs_defined=yes
299254974Sjlh
300254974Sjlh	# Compatibility with old daily variable names.
301254974Sjlh	# They can be removed in stable/11.
302254974Sjlh	security_daily_compat_var() {
303254974Sjlh		local var=$1 dailyvar value
304254974Sjlh
305257361Sjlh		dailyvar=daily_status_security${var#security_status}
306254974Sjlh		periodvar=${var%enable}period
307254974Sjlh		eval value=\"\$$dailyvar\"
308254974Sjlh		[ -z "$value" ] && return
309254974Sjlh		echo "Warning: Variable \$$dailyvar is deprecated," \
310254974Sjlh		    "use \$$var instead." >&2
311254974Sjlh		case "$value" in
312254974Sjlh		[Yy][Ee][Ss])
313254974Sjlh			$var=YES
314254974Sjlh			$periodvar=daily
315254974Sjlh			;;
316254974Sjlh		*)
317257364Sjlh			eval $var=\"$value\"
318254974Sjlh			;;
319254974Sjlh		esac
320254974Sjlh	}
321254974Sjlh
322254974Sjlh	check_yesno_period() {
323254974Sjlh		local var="$1" periodvar value period
324254974Sjlh
325254974Sjlh		eval value=\"\$$var\"
326254974Sjlh		case "$value" in
327254974Sjlh		[Yy][Ee][Ss]) ;;
328254974Sjlh		*) return 1 ;;
329254974Sjlh		esac
330254974Sjlh
331254974Sjlh		periodvar=${var%enable}period
332254974Sjlh		eval period=\"\$$periodvar\"
333254974Sjlh		case "$PERIODIC" in
334254974Sjlh		"security daily")
335254974Sjlh			case "$period" in
336254974Sjlh			[Dd][Aa][Ii][Ll][Yy]) return 0 ;;
337254974Sjlh			*) return 1 ;;
338254974Sjlh			esac
339254974Sjlh			;;
340254974Sjlh		"security weekly")
341254974Sjlh			case "$period" in
342254974Sjlh			[Ww][Ee][Ee][Kk][Ll][Yy]) return 0 ;;
343254974Sjlh			*) return 1 ;;
344254974Sjlh			esac
345254974Sjlh			;;
346254974Sjlh		"security monthly")
347254974Sjlh			case "$period" in
348254974Sjlh			[Mm][Oo][Nn][Tt][Hh][Ll][Yy]) return 0 ;;
349254974Sjlh			*) return 1 ;;
350254974Sjlh			esac
351254974Sjlh			;;
352254974Sjlh		security)
353254974Sjlh			# Run directly from crontab(5).
354254974Sjlh			case "$period" in
355254974Sjlh			[Nn][Oo]) return 1 ;;
356254974Sjlh			*) return 0 ;;
357254974Sjlh			esac
358254974Sjlh			;;
359254974Sjlh		*)
360254974Sjlh			echo "ASSERTION FAILED: Unexpected value for " \
361254974Sjlh			    "\$PERIODIC: '$PERIODIC'" >&2
362254974Sjlh			exit 127
363254974Sjlh			;;
364254974Sjlh		esac
365254974Sjlh	}
366254974Sjlh
367238416Skevlo        source_periodic_confs() {
36861981Sbrian                local i sourced_files
36961981Sbrian
37061981Sbrian                for i in ${periodic_conf_files}; do
37161981Sbrian                        case ${sourced_files} in
37261981Sbrian                        *:$i:*)
37361981Sbrian                                ;;
37461981Sbrian                        *)
37561981Sbrian                                sourced_files="${sourced_files}:$i:"
37661981Sbrian                                [ -r $i ] && . $i
37761981Sbrian                                ;;
37861981Sbrian                        esac
37961981Sbrian                done
38061981Sbrian        }
38161981Sbrianfi
382