Understanding the Automatons
Pages: 1, 2, 3
Let's take a quick look at each script, what it does, and whether or not
it runs by default. These details are described in man periodic.conf which I've summarized in the following chart:
| Name of script | Action | Default |
| Daily scripts: | ||
100.clean_disks |
removes all matching files | NO |
110.clean_tmps |
clears temporary directories | NO |
120.clean_preserve |
removes old files from /var/preserve |
YES |
130.clean_msgs |
old system messages purged | YES |
140.clean_rwho |
old files in /var/rwho purged |
YES |
150.clean_hoststat |
old files in /var/spool/.hoststat purged. |
YES |
200.backup_passwd |
/etc/master.passwd and /etc/group files backed up and modifications reported |
YES |
210.backup_aliases |
/etc/mail/aliases file backed up and modifications displayed |
YES |
220.backup_distfile |
/etc/Distfile file backed up and modifications displayed |
YES |
300.calendar |
runs calendar -a daily |
NO |
310.accounting |
rotates daily accounting files | YES |
320.distfile |
runs rdist(1) daily |
YES |
330.news |
runs /etc/news.expire |
YES |
340.uucp |
runs /etc/uuclean.daily |
YES |
400.status_disks |
runs df(1) and dump -W |
YES |
410.status_uucp |
runs uustat -a |
YES |
420.status_network |
runs netstat -i |
YES |
430.status_rwho |
runs uptime(1) |
YES |
440.status_mailq |
runs mailq(1) |
YES |
450.status_security |
runs /etc/security |
YES |
460.status_mail_rejects |
summarizes mail rejections logged to /var/log/maillog |
YES |
470.status_named |
summarizes denied zone transfers | YES |
500.queuerun |
manually runs the mail queue | YES |
999.local |
list of extra scripts in /etc/daily.local |
|
| Weekly Scripts | ||
120.clean_kvmdb |
purges old /var/db/kvm_*.db files |
YES |
300.uucp |
runs /usr/libexec/uucp/clean.weekly |
YES |
310.locate |
runs /usr/libexec/locate.updatedb |
YES |
320.whatis |
runs /usr/libexec/makewhatis.local |
YES |
330.catman |
runs /usr/libexec/catman.local |
NO |
340.noid |
locate files with an invalid owner or group (orphans) | NO |
400.status_pkg |
uses pkg_version(1) to list out of date installed packages | NO |
999.local |
list of extra scripts in /etc/weekly.local |
|
| Monthly Scripts | ||
200.accounting |
does login accounting using the ac(8) command |
YES |
999.local |
list of extra scripts in /etc/monthly.local |
|
You'll notice that there are quite a few scripts and most of them are enabled by default. Let's become the superuser and copy the default file to the file that we'll customize:
su
Password:
cp /etc/defaults/periodic.conf /etc/periodic.conf
I'll then open up /etc/periodic.conf in my favorite text editor and pick through the interesting lines. Let's start with this bit:
<snip>
# Daily options
# These options are used by periodic(8) itself to
# determine what to do with the output of the sub-programs
# that are run, and where to send that output. $daily_output
# might be set to /var/log/daily.log if you wish to log the
# daily output and have the files rotated by newsyslog(8)
#
daily_output="root" # user or /file
daily_show_success="YES" # scripts returning 0
daily_show_info="YES" # scripts returning 1
daily_show_badconfig="NO" # scripts returning 2
You'll note that by default, the results of running the daily scripts are emailed to root. If you check root's email, you'll see messages with the subject "hostname daily run output" and if you read one of those messages, the output should match up to the daily scripts that are marked as "YES". You can have the output sent to another user by replacing "root" with a user name on the "daily_output" line.
Alternatively, you can specify that the output be sent to a file, usually
/var/log/daily.log. This file doesn't exist by default, so you'll want to create it by using touch /var/log/daily.log.
