PERIODIC.CONF(5)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1, nixpkgs unstable

πŸ’– periodic.conf(5) πŸ’–

okay so welcome to the glow-up guide for periodic.conf(5) β€” it lives in the File Formats Manual section and it's literally the blueprint for how your machine's daily, weekly and monthly maintenance jobs should run. bestie, this file is the main character of your system's self-care routine, and we're about to read it together. periodt. πŸŽ€


✨ NAME ✨

periodic.conf β€” periodic job configuration information. that's it, that's the name, and honestly? iconic. πŸ’…


🌸 DESCRIPTION 🌸

so the file periodic.conf contains a description of how daily, weekly and monthly system maintenance jobs should run. it resides in the /etc/defaults directory, and parts of it may be overridden by a file of the same name in /etc β€” which itself may be overridden by the /etc/periodic.conf.local file. it's giving layered friendship bracelets, honestly. 🫢

the periodic.conf file is actually sourced as a shell script from each of the periodic scripts, and it's intended to simply provide default configuration variables. no cap, that's its whole job.

the following variables are used by periodic(8) itself:

  • local_periodic β€” (str) list of directories to search for periodic scripts. this list is always prefixed with /etc/periodic, and it's only used when an argument to periodic(8) is not an absolute directory name. so like, don't come for it with a full path, it won't even look.
  • ⟨dir⟩_output β€” (path or list) what to do with the output of the scripts executed from the directory dir. here's the tea: if this variable is set to an absolute path name, output is logged to that file. otherwise it's taken as one or more space separated email addresses and mailed to those users. and if this variable is not set or is empty, output is sent to standard output. simple as that. ✨

for an unattended machine, suitable values for daily_output, weekly_output, and monthly_output might be /var/log/daily.log, /var/log/weekly.log, and /var/log/monthly.log respectively β€” because newsyslog(8) will rotate these files (if they exists) at the appropriate times. (yes, "exists", that's what the original says, we don't fix it, we respect it. 🫑)

  • ⟨dir⟩_show_success, ⟨dir⟩_show_info, ⟨dir⟩_show_badconfig β€” (bool) these variables control whether periodic(8) will mask the output of the executed scripts based on their return code (where dir is the base directory name in which each script resides). here's the vibe check breakdown, bestie:
    • if the return code of a script is 0 and ⟨dir⟩_show_success is set to NO, periodic(8) will mask the script's output.
    • if the return code of a script is 1 and ⟨dir⟩_show_info is set to NO, periodic(8) will mask the script's output.
    • if the return code of a script is 2 and ⟨dir⟩_show_badconfig is set to NO, periodic(8) will mask the script's output.

and if these variables are set to neither YES nor NO, they default to YES, YES and NO respectively. πŸ‘‘

refer to the periodic(8) manual page for how script return codes are interpreted β€” that's the lore, go read it.

  • anticongestion_sleeptime β€” (int) the maximum number of seconds to randomly sleep in order to smooth bursty loads on a shared resource, such as a download mirror. it's literally the "everyone chill, we don't all have to hit the mirror at the exact same second" setting. 🌈

πŸ¦‹ the daily scripts πŸ¦‹

the following variables are used by the standard scripts that reside in /etc/periodic/daily:

  • daily_clean_disks_enable β€” (bool) set to YES if you want to remove all files matching daily_clean_disks_files daily.
  • daily_clean_disks_files β€” (str) set to a list of file names to match. wild cards are permitted. πŸƒ
  • daily_clean_disks_days β€” (num) when daily_clean_disks_enable is set to YES, this must also be set to the number of days old that a file's access and modification times must be before it is deleted. both, bestie, access and modification. πŸ’€
  • daily_clean_disks_verbose β€” (bool) set to YES if you want the removed files to be reported in your daily output.
  • daily_clean_tmps_enable β€” (bool) set to YES if you want to clear temporary directories daily. spring cleaning but make it a cron job. 🧹
  • daily_clean_tmps_dirs β€” (str) set to the list of directories to clear if daily_clean_tmps_enable is set to YES.
  • daily_clean_tmps_days β€” (num) when daily_clean_tmps_enable is set, this must also be set to the number of days old that a file's access and modification times must be before it is deleted.
  • daily_clean_tmps_ignore β€” (str) set to the list of files that should not be deleted when daily_clean_tmps_enable is set to YES. wild card characters are permitted. protect these files at all costs. πŸ›‘οΈ
  • daily_clean_tmps_verbose β€” (bool) set to YES if you want the removed files to be reported in your daily output.
  • daily_clean_preserve_enable β€” (bool) set to YES if you wish to remove old files from /var/preserve.
  • daily_clean_preserve_days β€” (num) set to the number of days that files must not have been modified before they are deleted.
  • daily_clean_preserve_verbose β€” (bool) set to YES if you want the removed files to be reported in your daily output.
  • daily_clean_msgs_enable β€” (bool) set to YES if you wish old system messages to be purged.
  • daily_clean_msgs_days β€” (num) set to the number of days that files must not have been modified before they are deleted. if this variable is left blank, the msgs(1) default is used.
  • daily_clean_rwho_enable β€” (bool) set to YES if you wish old files in /var/who to be purged.
  • daily_clean_rwho_days β€” (num) set to the number of days that files must not have been modified before they are deleted.
  • daily_clean_rwho_verbose β€” (bool) set to YES if you want the removed files to be reported in your daily output.
  • daily_clean_hoststat_enable β€” (bool) set to YES to run sendmail -bH to automatically purge stale entries from sendmail(8)'s host status cache. files will be deleted using the same criteria as sendmail(8) would normally use when determining whether to believe the cached information, as configured in /etc/mail/sendmail.cf. it's giving "trust but verify" energy. πŸ”
  • daily_backup_efi_enable β€” (bool) set to YES to create backup of EFI System Partition (ESP).
  • daily_backup_gmirror_enable β€” (bool) set to YES to create backup of gmirror information (i.e., output of gmirror list), see gmirror(8).
  • daily_backup_gmirror_verbose β€” (bool) set to YES to report a diff between the new backup and the existing backup in the daily output.
  • daily_backup_gpart_enable β€” (bool) set to YES to create backups of partition tables, and bootcode partition contents.
  • daily_backup_gpart_verbose β€” (bool) set to YES to be verbose if existing backups for kern.geom.conftxt or the partition tables differ from the new backups.
  • daily_backup_passwd_enable β€” (bool) set to YES if you want the /etc/master.passwd and /etc/group files backed up and reported on. reporting consists of checking both files for modifications and running chkgrp(8) on the group file. look at your group file getting a whole audit, we love accountability. 🫢
  • daily_backup_aliases_enable β€” (bool) set to YES if you want the /etc/mail/aliases file backed up and modifications to be displayed in your daily output.
  • daily_backup_zfs_enable β€” (bool) set to YES to create backup of the output generated from the zfs-list(8) and zpool-list(8) utilities.
  • daily_backup_zfs_list_flags β€” (str) set to the arguments for the zfs-list(8) utility. the default is standard behavior.
  • daily_backup_zpool_list_flags β€” (str) set to the arguments for the zpool-list(8) utility. the default is -v.
  • daily_backup_zfs_props_enable β€” (bool) set to YES to create backup of the output generated from the zfs-get(8) and zpool-get(8) utilities.
  • daily_backup_zfs_get_flags β€” (str) set to the arguments for the zfs-get(8) utility. the default is all.
  • daily_backup_zpool_get_flags β€” (str) set to the arguments for the zpool-get(8) utility. the default is all.
  • daily_backup_zfs_verbose β€” (bool) set to YES to report a diff between the new backup and the existing backup in the daily output.
  • daily_calendar_enable β€” (bool) set to YES if you want to run calendar -a daily.
  • daily_accounting_enable β€” (bool) set to YES if you want to rotate your daily process accounting files. no rotations are necessary unless accounting_enable is enabled in rc.conf(5). so like, check that first, bestie. πŸ‘€
  • daily_accounting_compress β€” (bool) set to YES if you want your daily accounting files to be compressed using gzip(1).
  • daily_accounting_save β€” (num) when daily_accounting_enable is set, this may also be set to the number of daily accounting files that are to be saved. the default is 3.
  • daily_accounting_flags β€” (str) set to the arguments to pass to the sa(8) utility (in addition to -s) when daily_accounting_enable is set to YES. the default is -q.
  • daily_status_disks_enable β€” (bool) set to YES if you want to run df(1) (with the arguments supplied in daily_status_disks_df_flags) and dump -W.
  • daily_status_disks_df_flags β€” (str) set to the arguments for the df(1) utility when daily_status_disks_enable is set to YES. the default is -l -h.
  • daily_status_zfs_enable β€” (bool) set to YES if you want to run zpool status on your zfs(8) pools.
  • daily_status_zfs_zpool_list_enable β€” (bool) set to YES if you want to run zpool list on your zfs(8) pools. requires daily_status_zfs_enable to be set to YES. dependency check, babes. πŸ”—
  • daily_status_gmirror_enable β€” (bool) set to YES if you want to run gmirror status on your gmirror(8) devices.
  • daily_status_graid3_enable β€” (bool) set to YES if you want to run graid3 status on your graid3(8) devices.
  • daily_status_gstripe_enable β€” (bool) set to YES if you want to run gstripe status on your gstripe(8) devices.
  • daily_status_gconcat_enable β€” (bool) set to YES if you want to run gconcat status on your gconcat(8) devices.
  • daily_status_mfi_enable β€” (bool) set to YES if you want to run mfiutil status on your mfi(4) devices.
  • daily_status_network_enable β€” (bool) set to YES if you want to run netstat -i.
  • daily_status_network_netstat_flags β€” (str) extra arguments you can pass to the netstat(1) utility whenever daily_status_network_enable is set to "YES". The default is -d -W. πŸŽ€
  • daily_status_network_usedns β€” (bool) set it to "YES" if you want netstat(1) to run without the -n option, which means it'll actually do DNS lookups. slow but ✨named✨.
  • daily_status_uptime_enable β€” (bool) set to "YES" if you want to run uptime(1) β€” or ruptime(1) instead, if rwhod_enable is set to "YES" in /etc/rc.conf. conditional queen πŸ’…
  • daily_status_mailq_enable β€” (bool) set to "YES" if you want to run mailq(1). that's it. that's the whole vibe.
  • daily_status_mailq_shorten β€” (bool) set to "YES" if you want to shorten the mailq(1) output β€” and yes, this only does anything when daily_status_mailq_enable is set to "YES". no cap.
  • daily_status_include_submit_mailq β€” (bool) set to "YES" if you also want to run mailq(1) on the submit mail queue when daily_status_mailq_enable is set to "YES". heads up though: this may not work with MTAs other than sendmail(8). 🫢
  • daily_status_security_enable β€” (bool) set to "YES" if you want to run the security check. and plot twist β€” the security check is another whole set of periodic(8) scripts. the system defaults live in /etc/periodic/security, and your local scripts go in /usr/local/etc/periodic/security. peep the periodic(8) manual page for more info. πŸ‘‘
  • daily_status_security_inline β€” (bool) set to "YES" if you want the security check output inline. if you don't, the default is to either mail or log the output β€” whichever daily_status_security_output says. 😌
  • daily_status_security_output β€” (str) where the security check output goes when daily_status_security_inline is set to "NO". behaves exactly like the *_output variables above, meaning it can be either one or more email addresses, or one absolute file name. your call bestie.
  • daily_status_mail_rejects_enable β€” (bool) set to "YES" if you want to summarise the mail rejections logged to /var/log/maillog for the previous day. receipts! 🧾
  • daily_status_mail_rejects_logs β€” (num) set this to the number of maillog files that should be checked for yesterday's mail rejects.
  • daily_status_ntpd_enable β€” (bool) set to "YES" if you want to enable the NTP status check. time is real ⏰
  • daily_status_world_kernel β€” (bool) set to "YES" to check that the running userland and kernel are in sync. matching outfits check βœ¨πŸ‘―βœ¨
  • daily_queuerun_enable β€” (bool) set to "YES" if you want to manually run the mail queue at least once a day.
  • daily_submit_queuerun β€” (bool) set to "YES" if you also want to manually run the submit mail queue at least once a day β€” and yeah, this one only kicks in when daily_queuerun_enable is set to "YES". team effort 🫢
  • daily_scrub_zfs_enable β€” (bool) set to "YES" if you want to run a zfs scrub periodically. self care for your pools πŸ§–β€β™€οΈ
  • daily_scrub_zfs_pools β€” (str) a space separated list of names of zfs pools to scrub. if the list is empty or not set, all zfs pools get scrubbed. all of them. periodt.
  • daily_scrub_zfs_default_threshold β€” (int) number of days between a scrub if no pool-specific threshold is set. if you don't set it, the default value is 35, which corresponds to 5 weeks. math slay πŸ”₯
  • daily_scrub_zfs_⟨poolname⟩_threshold β€” (int) literally the same as daily_scrub_zfs_default_threshold but specific to the pool ⟨poolname⟩. main character energy, per pool.
  • daily_trim_zfs_enable β€” (bool) set to "YES" if you want to run a zfs trim daily. glow up on the schedule πŸ’…
  • daily_trim_zfs_pools β€” (str) a space separated list of names of zfs pools to trim. if the list is empty or not set, all zfs pools are trimmed. iykyk.
  • daily_local β€” (str) set this to a list of extra scripts that should be run after all the other daily scripts. every single script has to be an absolute path name. no shortcuts, no relative paths, we don't do that here. 🚫
  • daily_diff_flags β€” (str) set to the arguments to pass to the diff(1) utility when generating differences. the default is -b -U 0.

so yeah, those were all the daily ones πŸ’– now the weekly girlies:

the following variables are used by the standard scripts that reside in /etc/periodic/weekly:

  • weekly_locate_enable β€” (bool) set to "YES" if you want to run /usr/libexec/locate.updatedb. this script runs using nice -5 as user "nobody", and it generates the table used by the locate(1) command. humble but essential 🌸
  • weekly_whatis_enable β€” (bool) set to "YES" if you want to run /usr/libexec/makewhatis.local. this script regenerates the database used by the apropos(1) command. databases getting a refresh 😌✨
  • weekly_noid_enable β€” (bool) set to "YES" if you want to locate orphaned files on the system. and what's an orphaned file bestie? it's one with an invalid owner or group. πŸ₯²
  • weekly_noid_dirs β€” (str) a list of directories under which orphaned files are searched for. this would usually be set to /. go big or go home.
  • weekly_status_security_enable β€” (bool) the weekly counterpart of daily_status_security_enable. same energy, different day πŸ‘‘
  • weekly_status_security_inline β€” (bool) the weekly counterpart of daily_status_security_inline.
  • weekly_status_security_output β€” (str) the weekly counterpart of daily_status_security_output.
  • weekly_status_pkg_enable β€” (bool) set to "YES" if you want to use pkg-version(8) to list the installed packages that are out of date. expired package alert 🚨
  • pkg_version β€” (str) when weekly_status_pkg_enable is set to "YES", this variable specifies the program that's used to determine the out of date packages. if it's unset, the pkg-version(8) program is used. for example, this variable might be set to "portversion" if the ports/sysutils/portupgrade port has been installed. options, options πŸ¦‹
  • pkg_version_index β€” (str) this variable specifies the INDEX file from /usr/ports that should be used by pkg-version(8). because the dependency tree may be substantially different between versions of FreeBSD, there may be more than one INDEX file in /usr/ports. literally just be aware.
⚠️ btw note this: if the pkg_version variable is set to "portversion", it will also be necessary to arrange that the correct INDEX file is specified using environment variables β€” and that pkg_version_index is cleared in /etc/periodic.conf (pkg_version_index=). don't skip that part, it matters fr fr 😭
  • weekly_local β€” (str) set to a list of extra scripts that should be run after all the other weekly scripts. all scripts must be absolute path names. same rule as daily, no exceptions πŸ’…

monthly time, we love a monthly icon πŸŒ™

the following variables are used by the standard scripts that reside in /etc/periodic/monthly:

  • monthly_accounting_enable β€” (bool) set to "YES" if you want to do login accounting using the ac(8) command. crunching the numbers πŸ“Š
  • monthly_status_security_enable β€” (bool) the monthly counterpart of daily_status_security_enable.
  • monthly_status_security_inline β€” (bool) the monthly counterpart of daily_status_security_inline.
  • monthly_status_security_output β€” (str) the monthly counterpart of daily_status_security_output.
  • monthly_local β€” (str) set to a list of extra scripts that should be run after all the other monthly scripts. all scripts must be absolute path names. yes, again. absolute. path. names. πŸŽ€

and now the security block, aka the ✨vibe check✨ section:

the following variables are used by the standard scripts that reside in /etc/periodic/security. those scripts are usually run from the daily hook (daily_status_security_enable), the weekly hook (weekly_status_security_enable), and the monthly hook (monthly_status_security_enable). the ..._period of each script can be configured as "daily", "weekly", "monthly" or "NO". πŸ’«

⚠️ and note this: when the periodic security scripts are run from crontab(5), they will always be run unless their ..._enable or ..._period variable is set to "NO". so like, opt out loudly or not at all.
  • security_status_diff_flags β€” (str) set to the arguments to pass to the diff(1) utility when generating differences. the default is -b -U 0.
  • security_status_chksetuid_enable β€” (bool) set to "YES" to compare the modes and modification times of setuid executables with the previous day's values. spotting the differences πŸ•΅οΈβ€β™€οΈ
  • security_status_chksetuid_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_chkportsum_enable β€” (bool) set to "YES" to verify the checksums of all installed packages against the known checksums in /var/db/pkg. trust but verify πŸ’œ
  • security_status_chkportsum_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_neggrpperm_enable β€” (bool) set to "YES" to check for files where the group of a file has less permissions than the world at large. heads up though β€” when users are in more than 14 supplemental groups, these negative permissions may not be enforced via NFS shares. 😬 noted.
  • security_status_neggrpperm_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_chkmounts_enable β€” (bool) set to "YES" to check for changes mounted file systems to the previous day's values.
  • security_status_chkmounts_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_noamd β€” (bool) set to "YES" if you want to ignore amd(8) mounts when comparing against yesterday's file system mounts in the security_status_chkmounts_enable check. amd who? never heard of her πŸ™ˆ
  • security_status_chkuid0_enable β€” (bool) set to "YES" to check /etc/master.passwd for accounts with UID 0. root imposters better watch out πŸ‘€
  • security_status_chkuid0_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_passwdless_enable β€” (bool) set to "YES" to check /etc/master.passwd for accounts with empty passwords. empty?? password?? absolutely not 🚩
  • security_status_passwdless_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_logincheck_enable β€” (bool) set to "YES" to check /etc/login.conf ownership β€” see login.conf(5) for more information.
  • security_status_logincheck_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_ipfwdenied_enable β€” (bool) set to "YES" to show log entries for packets denied by ipfw(8) since yesterday's check. denied. blocked. unfollowed. πŸ’€
  • security_status_ipfwdenied_period β€” (str) set to either "daily", "weekly", "monthly" or "NO".
  • security_status_ipfdenied_enable β€” (bool) set to "YES" to show log entries for packets denied by ipf(8) since yesterday's check. same vibe, different firewall πŸ”₯
  • security_status_ipfdenied_period β€” a string, bestie, and it's gotta be exactly one of daily, weekly, monthly, or NO. That's the whole menu, no substitutions πŸ’…
  • security_status_pfdenied_enable β€” bool. Set it to YES and you'll get log entries for all the packets that pf(4) straight-up denied since yesterday's check. Rude packets getting exposed, love that for us 🫢
  • security_status_pfdenied_additionalanchors β€” str, and it's a space-separated list of extra anchors whose denied-packet log entries you want shown. Heads up tho: the main ruleset (that's the empty-string anchor) and any blocklistd(8) anchors, if there are any, are always shown no matter what. Non-negotiable, they're the main characters πŸ‘‘
  • security_status_pfdenied_period β€” str. daily, weekly, monthly, or NO. Pick one, queen ✨
  • security_status_ipfwlimit_enable β€” bool. YES means you see the ipfw(8) rules that have hit their verbosity limit. They're maxed out and they need to be witnessed 😭
  • security_status_ipfwlimit_period β€” str. daily, weekly, monthly, or NO. Same drill πŸŽ€
  • security_status_kernelmsg_enable β€” bool. YES = show all the fresh dmesg(8) entries that have appeared since yesterday's check. New lore dropped πŸ¦‹
  • security_status_kernelmsg_period β€” str. daily, weekly, monthly, or NO. You know the vibes πŸ’œ
  • security_status_loginfail_enable β€” bool. YES and you get all the failed logins from /var/log/messages over the previous day. Somebody was guessing passwords and now everybody knows πŸ™ˆ
  • security_status_loginfail_period β€” str. daily, weekly, monthly, or NO. Periodt πŸ’…
  • security_status_tcpwrap_enable β€” bool. YES shows you the connections that got denied by tcpwrappers (peep hosts_access(5)) straight out of /var/log/messages for the previous day. Blocked and beautiful 🌸
  • security_status_tcpwrap_period β€” str. daily, weekly, monthly, or NO. That's it, that's the list πŸ“

πŸ“ FILES πŸ“

Okay so here's where all these overrides actually live, and the layering is honestly iconic:

  • /etc/defaults/periodic.conf β€” the default configuration file, fr fr. It holds all the default variables and values, like the blueprint of the whole operation πŸ‘‘
  • /etc/periodic.conf β€” the usual system-specific variable override file. This is where you, personally, go off πŸ’…
  • /etc/periodic.conf.local β€” an extra override file, and it's lowkey the MVP when /etc/periodic.conf is shared or distributed, because you can keep your own local tweaks separate. Chef's kiss πŸŽ€

πŸ‘€ SEE ALSO πŸ‘€

Go read these, they're all linked and they all ate:

apropos(1), calendar(1), df(1), diff(1), gzip(1), locate(1), man(1), msgs(1), netstat(1), nice(1), login.conf(5), rc.conf(5), ac(8), chkgrp(8), dump(8), newsyslog(8), periodic(8), pkg-version(8), sendmail(8)


πŸ•°οΈ HISTORY πŸ•°οΈ

The periodic.conf file showed up in FreeBSD 4.1. Vintage. Ancient. Still slaying ✨


🫢 AUTHORS 🫢

Brian Somers <brian@Awfulhak.org> β€” thank you for your service, king πŸ‘‘


Real talk before you go: this whole thing is Debian's page, dated April 9, 2024, for PERIODIC.CONF(5). Go configure your periodic jobs, bestie, you've got this πŸ’–πŸŒˆβ­
πŸ“¦ where this page comes from