What does /etc/periodic/daily/100.clean-disks do?

Hi all =)

Today I noticed that /etc/periodic/daily/100.clean-disks does a find / ... and deletes everything that matches:

Code:
                sed -e 's/^[    ]*//' \
                    -e 's/[     ]*$//' \
                    -e 's/[     ][      ]*/ -o -name /g'`

The comment in the header says

Code:
# Remove garbage files more than $daily_clean_disks_days days old

but what is the purpose of this? And does it really scan and delete in my ZFS storage pool at /tank ?

What would happen if I remove this script?

Hugs,
Sandra =)
 
Look in /etc/defaults/periodic.conf:
Code:
daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*"
Those are the files it deletes.

What would happen if I remove this script?
Don't. It's disabled by default anyway.
 
That's very interesting. I do see
Code:
daily_clean_disks_enable="NO"
in /etc/defaults/periodic.conf, but I still see the find / ... being executed from this script. So you would keep it, but modify it to exclude /tank?
 
You posted /etc/defaults/periodic.conf, not /etc/periodic.conf. If the latter doesn't exist the settings from the default file will be used. And the default setting for daily_clean_disks_enable is NO.
 
Keep in mind that data in /tmp/ is cleared when daily_clean_tmps_enable is enabled (it's disabled by default) regardless of the setting of daily_clean_disks_enable. Also note that if you use tmpfs(5) and reboot the machine the /tmp/ directory will be empty too.
 
Yesterday I added
Code:
touch /tmp/100find
to /etc/periodic/daily/100.clean-disks, and /etc/defaults/periodic.conf is unchanged from the attached last time, ie.
Code:
daily_clean_disks_enable="NO"
but it is still being run.

Code:
# ll /etc/periodic/daily/100.clean-disks /tmp/100find 
-rwxr-xr-x  1 root  wheel  1308 Sep 26 15:29 /etc/periodic/daily/100.clean-disks
-rw-r--r--  1 root  wheel     0 Sep 27 03:01 /tmp/100find
 
Note that you mustn't change or edit /etc/defaults/periodic.conf as is quoted in the file header.
# This is defaults/periodic.conf - a file full of useful variables that
# you can set to change the default behaviour of periodic jobs on your
# system. You should not edit this file! Put any overrides into one of the
# $periodic_conf_files instead and you will be able to update these defaults
# later without spamming your local configuration information.

Add the following to /etc/periodic.conf
Code:
# 100.clean-disks
daily_clean_disks_enable="NO"

Also, uses this example to apply it for your purposes (common used variables are included).
 
These are the periodic scripts that are enabled by default and use /usr/bin/find.

daily_clean_preserve_enable
daily_clean_rwho_enable
daily_status_named_enable
daily_status_security_chksetuid_enable
daily_status_security_neggrpperm_enable
daily_status_security_loginfail_enable
daily_status_security_tcpwrap_enable
 
Back
Top