Solved Getting to grips with periodic

/etc/defaults/periodic.conf says:

Code:
# What files override these defaults ?                                                                                                                                         
periodic_conf_files="/etc/periodic.conf /etc/periodic.conf.local"                                                                                                             
                                                                                                                                                                              
# periodic script dirs                                                                                                                                                         
local_periodic="/usr/local/etc/periodic"

Not really sure how to use all these files. I guess I should copy /etc/defaults/periodic.conf to /etc/periodic.conf and not touch the original.

What is the .local file for?

/etc/periodic/ contains all the periodic scripts. What is the dir in /usr/local/etc for? And what is the order of precedence if there are scripts with the same names in two dirs?
 
You don't have to copy default file, just override values you want in /etc/periodic.conf and you are good to go. /etc/periodic.conf.local would override /etc/periodic.conf values, useful if you have on periodic.conf shared/distributed over multiple machines and wan't some local only adjustments. Probably not your case right now.

/usr/local/etc/periodic/ is for periodic script which are not part of OS, i. e. from ports or your own.
 
Not really sure how to use all these files. I guess I should copy /etc/defaults/periodic.conf to /etc/periodic.conf and not touch the original.
It works the same as /etc/defaults/rc.conf and /etc/rc.conf. You don't copy /etc/defaults/rc.conf to /etc/rc.conf, you only put changes in /etc/rc.conf.
 
It works the same as /etc/defaults/rc.conf and /etc/rc.conf. You don't copy /etc/defaults/rc.conf to /etc/rc.conf, you only put changes in /etc/rc.conf.
Does this mean that if I want to make changes to sections 100.clean-disks or 110.clean-tmps (for example) I would just put those two sections in /etc/periodic.conf and they would override the default?
 
You only need to put modified values into /etc/periodic.conf and /etc/rc.conf. Copying anything else does nothing useful and may later prevent your system picking-up modified defaults. Don't modify anything under /etc/defaults.
 
What do I do if want to make this change:-


or enable/disable a particular script?
I put all my periodic output to files instead of emailing them, so I created a file /etc/periodic.conf which overrides the defaults in /etc/defaults/periodic.conf. It has the following:
Code:
# periodic.conf overrides
# output to file
daily_output="/var/log/daily.log"
daily_status_security_output="/var/log/dailysecurity.log"
daily_status_network_usedns="NO"
daily_status_named_usedns="NO"
daily_clean_tmps_enable="YES"
daily_status_ntpd_enable="NO"
daily_status_zfs_enable="YES"
daily_scrub_zfs_enable="NO"    # set to YES for autoscrubbing at threshold days
daily_scrub_zfs_default_threshold="45"          # days between scrubs
daily_status_smart_enable="YES"
daily_status_smart_devices="/dev/ada0"
daily_queuerun_enable="NO"
weekly_output="/var/log/weekly.log"
weekly_status_security_output="/var/log/weeklysecurity.log"
monthly_output="/var/log/monthly.log"
monthly_status_security_output="/var/log/monthlysecurity.log"
# Security audit for base from package base-audit
security_status_baseaudit_enable="YES"
security_status_baseaudit_quiet="NO"
 
Comments in the top of the script will tell you how to enable/disable it and which parameters you could set.
Yes, I know, that, but it was suggested that I don't modify anything under /etc/defaults/, so should I copy the whole of periodic.conf to /etc/ or just sections which I wish to amend?

in Thread 90158/#post-620707 I was told:-

You don't have to copy default file, just override values you want in /etc/periodic.conf

so I'm a bit confused as to how to do this...

.... following mer 's example I have a much clearer idea
 
so I'm a bit confused as to how to do this...
No you don't want to copy all of /etc/defaults/periodic.conf to /etc/periodic.conf.
What you want to do is create /etc/periodic.conf and copy any of the variables you want to override, just like I did in my example.

If you do not want to run say 100.chksetuid, you put the following line in your /etc/periodic.conf:
security_status_chksetuid_enable="NO"

Then repeat for everything else you want to override.
 
I thought I had managed to understand periodic, but *.core files are not being deleted.

Here is part of my /etc/defaults/periodic.conf:-

Code:
daily_output=/var/log/periodic/daily.log                # user or /file
daily_show_success="YES"                                # scripts returning 0
daily_show_info="YES"                                   # scripts returning 1
daily_show_badconfig="NO"                               # scripts returning 2

# 100.clean-disks
daily_clean_disks_enable="YES"                          # Delete files daily
daily_clean_disks_files=".serverauth.* [#,]* .#* a.out *.core *.CKP .emacs_[0-9]*"
daily_clean_disks_days=3                                # If older than this
daily_clean_disks_verbose="YES"                         # Mention files deleted

but...

Code:
root@X1:/# ls -al ~/*.core
-rw-------  1 root  wheel  1156722688 Sep 15 00:05 /root/kodi.bin.core
-rw-------  1 root  wheel   293830656 Sep 23 13:15 /root/vlc.core

Why have these two *.core files not been deleted?
 
*.core files are not being deleted
Not a reply to your question, but a suggestion. If you don't want to analize the core dumps to get to know the cause, you can inhibit the creation of them.

/etc/sysctl.conf
Code:
kern.coredump=0

I believe it can be also unset from /etc/login.conf with the resource limit coredumpsize=0
 
Here is part of my /etc/defaults/periodic.conf:-
Have you modified that file?
Reason for asking is on my system that file has daily_clean_disks_enable="NO"

Aside from that, those corefiles have rw for "user" and nothing for everyone else. I think periodic should be running as root, but if not that would explain why the cores are not deleted.
 
You can run /etc/periodic/daily/100.clean-disks (or any of the other periodic(8) scripts) by hand, it should print some output to STDERR.

Code:
      rc=$(find / \( ! -fstype local -o -fstype rdonly \) -prune -o \
    \( $args \) -atime +$daily_clean_disks_days \
    -execdir rm -df {} \; $print | tee /dev/stderr | wc -l)

Just # /etc/periodic/daily/100.clean-disks
 
Back
Top