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