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