PERIODIC.CONF(5)
π 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 toperiodic(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 whetherperiodic(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
0andβ¨dirβ©_show_successis set toNO,periodic(8)will mask the script's output. - if the return code of a script is
1andβ¨dirβ©_show_infois set toNO,periodic(8)will mask the script's output. - if the return code of a script is
2andβ¨dirβ©_show_badconfigis set toNO,periodic(8)will mask the script's output.
- if the return code of a script is
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 toYESif you want to remove all files matchingdaily_clean_disks_filesdaily.daily_clean_disks_filesβ (str) set to a list of file names to match. wild cards are permitted. πdaily_clean_disks_daysβ (num) whendaily_clean_disks_enableis set toYES, 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 toYESif you want the removed files to be reported in your daily output.daily_clean_tmps_enableβ (bool) set toYESif 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 ifdaily_clean_tmps_enableis set toYES.daily_clean_tmps_daysβ (num) whendaily_clean_tmps_enableis 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 whendaily_clean_tmps_enableis set toYES. wild card characters are permitted. protect these files at all costs. π‘οΈdaily_clean_tmps_verboseβ (bool) set toYESif you want the removed files to be reported in your daily output.daily_clean_preserve_enableβ (bool) set toYESif 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 toYESif you want the removed files to be reported in your daily output.daily_clean_msgs_enableβ (bool) set toYESif 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, themsgs(1)default is used.daily_clean_rwho_enableβ (bool) set toYESif you wish old files in/var/whoto 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 toYESif you want the removed files to be reported in your daily output.daily_clean_hoststat_enableβ (bool) set toYESto runsendmail -bHto automatically purge stale entries fromsendmail(8)'s host status cache. files will be deleted using the same criteria assendmail(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 toYESto create backup of EFI System Partition (ESP).daily_backup_gmirror_enableβ (bool) set toYESto create backup of gmirror information (i.e., output ofgmirror list), seegmirror(8).daily_backup_gmirror_verboseβ (bool) set toYESto report a diff between the new backup and the existing backup in the daily output.daily_backup_gpart_enableβ (bool) set toYESto create backups of partition tables, and bootcode partition contents.daily_backup_gpart_verboseβ (bool) set toYESto be verbose if existing backups forkern.geom.conftxtor the partition tables differ from the new backups.daily_backup_passwd_enableβ (bool) set toYESif you want the/etc/master.passwdand/etc/groupfiles backed up and reported on. reporting consists of checking both files for modifications and runningchkgrp(8)on the group file. look at your group file getting a whole audit, we love accountability. π«Άdaily_backup_aliases_enableβ (bool) set toYESif you want the/etc/mail/aliasesfile backed up and modifications to be displayed in your daily output.daily_backup_zfs_enableβ (bool) set toYESto create backup of the output generated from thezfs-list(8)andzpool-list(8)utilities.daily_backup_zfs_list_flagsβ (str) set to the arguments for thezfs-list(8)utility. the default is standard behavior.daily_backup_zpool_list_flagsβ (str) set to the arguments for thezpool-list(8)utility. the default is-v.daily_backup_zfs_props_enableβ (bool) set toYESto create backup of the output generated from thezfs-get(8)andzpool-get(8)utilities.daily_backup_zfs_get_flagsβ (str) set to the arguments for thezfs-get(8)utility. the default isall.daily_backup_zpool_get_flagsβ (str) set to the arguments for thezpool-get(8)utility. the default isall.daily_backup_zfs_verboseβ (bool) set toYESto report a diff between the new backup and the existing backup in the daily output.daily_calendar_enableβ (bool) set toYESif you want to runcalendar -adaily.daily_accounting_enableβ (bool) set toYESif you want to rotate your daily process accounting files. no rotations are necessary unlessaccounting_enableis enabled inrc.conf(5). so like, check that first, bestie. πdaily_accounting_compressβ (bool) set toYESif you want your daily accounting files to be compressed usinggzip(1).daily_accounting_saveβ (num) whendaily_accounting_enableis set, this may also be set to the number of daily accounting files that are to be saved. the default is3.daily_accounting_flagsβ (str) set to the arguments to pass to thesa(8)utility (in addition to-s) whendaily_accounting_enableis set toYES. the default is-q.daily_status_disks_enableβ (bool) set toYESif you want to rundf(1)(with the arguments supplied indaily_status_disks_df_flags) anddump -W.daily_status_disks_df_flagsβ (str) set to the arguments for thedf(1)utility whendaily_status_disks_enableis set toYES. the default is-l -h.daily_status_zfs_enableβ (bool) set toYESif you want to runzpool statuson yourzfs(8)pools.daily_status_zfs_zpool_list_enableβ (bool) set toYESif you want to runzpool liston yourzfs(8)pools. requiresdaily_status_zfs_enableto be set toYES. dependency check, babes. πdaily_status_gmirror_enableβ (bool) set toYESif you want to rungmirror statuson yourgmirror(8)devices.daily_status_graid3_enableβ (bool) set toYESif you want to rungraid3 statuson yourgraid3(8)devices.daily_status_gstripe_enableβ (bool) set toYESif you want to rungstripe statuson yourgstripe(8)devices.daily_status_gconcat_enableβ (bool) set toYESif you want to rungconcat statuson yourgconcat(8)devices.daily_status_mfi_enableβ (bool) set toYESif you want to runmfiutil statuson yourmfi(4)devices.daily_status_network_enableβ (bool) set toYESif you want to runnetstat -i.daily_status_network_netstat_flagsβ (str) extra arguments you can pass to thenetstat(1)utility wheneverdaily_status_network_enableis set to "YES". The default is-d -W. πdaily_status_network_usednsβ (bool) set it to "YES" if you wantnetstat(1)to run without the-noption, which means it'll actually do DNS lookups. slow but β¨namedβ¨.daily_status_uptime_enableβ (bool) set to "YES" if you want to runuptime(1)β orruptime(1)instead, ifrwhod_enableis set to "YES" in/etc/rc.conf. conditional queen πdaily_status_mailq_enableβ (bool) set to "YES" if you want to runmailq(1). that's it. that's the whole vibe.daily_status_mailq_shortenβ (bool) set to "YES" if you want to shorten themailq(1)output β and yes, this only does anything whendaily_status_mailq_enableis set to "YES". no cap.daily_status_include_submit_mailqβ (bool) set to "YES" if you also want to runmailq(1)on the submit mail queue whendaily_status_mailq_enableis set to "YES". heads up though: this may not work with MTAs other thansendmail(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 ofperiodic(8)scripts. the system defaults live in/etc/periodic/security, and your local scripts go in/usr/local/etc/periodic/security. peep theperiodic(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 β whicheverdaily_status_security_outputsays. πdaily_status_security_outputβ (str) where the security check output goes whendaily_status_security_inlineis set to "NO". behaves exactly like the*_outputvariables 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/maillogfor 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 whendaily_queuerun_enableis 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 is35, which corresponds to 5 weeks. math slay π₯daily_scrub_zfs_β¨poolnameβ©_thresholdβ (int) literally the same asdaily_scrub_zfs_default_thresholdbut 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 thediff(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 usingnice -5as user "nobody", and it generates the table used by thelocate(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 theapropos(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 ofdaily_status_security_enable. same energy, different day πweekly_status_security_inlineβ (bool) the weekly counterpart ofdaily_status_security_inline.weekly_status_security_outputβ (str) the weekly counterpart ofdaily_status_security_output.weekly_status_pkg_enableβ (bool) set to "YES" if you want to usepkg-version(8)to list the installed packages that are out of date. expired package alert π¨pkg_versionβ (str) whenweekly_status_pkg_enableis set to "YES", this variable specifies the program that's used to determine the out of date packages. if it's unset, thepkg-version(8)program is used. for example, this variable might be set to "portversion" if theports/sysutils/portupgradeport has been installed. options, options π¦pkg_version_indexβ (str) this variable specifies theINDEXfile from/usr/portsthat should be used bypkg-version(8). because the dependency tree may be substantially different between versions of FreeBSD, there may be more than oneINDEXfile in/usr/ports. literally just be aware.
β οΈ btw note this: if thepkg_versionvariable is set to "portversion", it will also be necessary to arrange that the correctINDEXfile is specified using environment variables β and thatpkg_version_indexis 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 theac(8)command. crunching the numbers πmonthly_status_security_enableβ (bool) the monthly counterpart ofdaily_status_security_enable.monthly_status_security_inlineβ (bool) the monthly counterpart ofdaily_status_security_inline.monthly_status_security_outputβ (str) the monthly counterpart ofdaily_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 fromcrontab(5), they will always be run unless their..._enableor..._periodvariable 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 thediff(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 ignoreamd(8)mounts when comparing against yesterday's file system mounts in thesecurity_status_chkmounts_enablecheck. amd who? never heard of her πsecurity_status_chkuid0_enableβ (bool) set to "YES" to check/etc/master.passwdfor 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.passwdfor 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.confownership β seelogin.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 byipfw(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 byipf(8)since yesterday's check. same vibe, different firewall π₯security_status_ipfdenied_periodβ a string, bestie, and it's gotta be exactly one ofdaily,weekly,monthly, orNO. That's the whole menu, no substitutions πsecurity_status_pfdenied_enableβ bool. Set it toYESand you'll get log entries for all the packets thatpf(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 anyblocklistd(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, orNO. Pick one, queen β¨security_status_ipfwlimit_enableβ bool.YESmeans you see theipfw(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, orNO. Same drill πsecurity_status_kernelmsg_enableβ bool.YES= show all the freshdmesg(8)entries that have appeared since yesterday's check. New lore dropped π¦security_status_kernelmsg_periodβ str.daily,weekly,monthly, orNO. You know the vibes πsecurity_status_loginfail_enableβ bool.YESand you get all the failed logins from/var/log/messagesover the previous day. Somebody was guessing passwords and now everybody knows πsecurity_status_loginfail_periodβ str.daily,weekly,monthly, orNO. Periodt πsecurity_status_tcpwrap_enableβ bool.YESshows you the connections that got denied by tcpwrappers (peephosts_access(5)) straight out of/var/log/messagesfor the previous day. Blocked and beautiful πΈsecurity_status_tcpwrap_periodβ str.daily,weekly,monthly, orNO. 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.confis 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
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 2000 Brian Somers <brian@Awfulhak.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms