diff options
author | ache <ache@FreeBSD.org> | 2004-02-28 04:58:40 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2004-02-28 04:58:40 +0000 |
commit | 3821a70e28e404f643922d5338226fbfa2b73776 (patch) | |
tree | a5981f1f3f10b6fea18201f911226c190a6c20a7 /etc/periodic/daily/110.clean-tmps | |
parent | 2ab34869c76f8a042b6184c67a9bc736b9b43d57 (diff) | |
download | FreeBSD-src-3821a70e28e404f643922d5338226fbfa2b73776.zip FreeBSD-src-3821a70e28e404f643922d5338226fbfa2b73776.tar.gz |
Don't remove empty dirs if their names are in $daily_clean_tmps_ignore
Diffstat (limited to 'etc/periodic/daily/110.clean-tmps')
-rwxr-xr-x | etc/periodic/daily/110.clean-tmps | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/etc/periodic/daily/110.clean-tmps b/etc/periodic/daily/110.clean-tmps index 0d2e96a..eef3bc6 100755 --- a/etc/periodic/daily/110.clean-tmps +++ b/etc/periodic/daily/110.clean-tmps @@ -28,9 +28,13 @@ case "$daily_clean_tmps_enable" in set -f noglob args="-atime +$daily_clean_tmps_days -mtime +$daily_clean_tmps_days" args="${args} -ctime +$daily_clean_tmps_days" - [ -n "$daily_clean_tmps_ignore" ] && + dargs="-empty -mtime +$daily_clean_tmps_days" + [ -n "$daily_clean_tmps_ignore" ] && { args="$args "`echo " ${daily_clean_tmps_ignore% }" | sed 's/[ ][ ]*/ ! -name /g'` + dargs="$dargs "`echo " ${daily_clean_tmps_ignore% }" | + sed 's/[ ][ ]*/ ! -name /g'` + } case "$daily_clean_tmps_verbose" in [Yy][Ee][Ss]) print=-print;; @@ -42,8 +46,7 @@ case "$daily_clean_tmps_enable" in do [ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && { find -d . -type f $args -delete $print - find -d . ! -name . -type d -empty -mtime \ - +$daily_clean_tmps_days -delete $print + find -d . ! -name . -type d $dargs -delete $print } | sed "s,^\\., $dir," done | tee /dev/stderr | wc -l) [ -z "$print" ] && rc=0 |