mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
Don't remove empty dirs if their names are in $daily_clean_tmps_ignore
This commit is contained in:
parent
6b3573d8f0
commit
6fec5a9e2a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=126342
@ -28,9 +28,13 @@ case "$daily_clean_tmps_enable" in
|
|||||||
set -f noglob
|
set -f noglob
|
||||||
args="-atime +$daily_clean_tmps_days -mtime +$daily_clean_tmps_days"
|
args="-atime +$daily_clean_tmps_days -mtime +$daily_clean_tmps_days"
|
||||||
args="${args} -ctime +$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% }" |
|
args="$args "`echo " ${daily_clean_tmps_ignore% }" |
|
||||||
sed 's/[ ][ ]*/ ! -name /g'`
|
sed 's/[ ][ ]*/ ! -name /g'`
|
||||||
|
dargs="$dargs "`echo " ${daily_clean_tmps_ignore% }" |
|
||||||
|
sed 's/[ ][ ]*/ ! -name /g'`
|
||||||
|
}
|
||||||
case "$daily_clean_tmps_verbose" in
|
case "$daily_clean_tmps_verbose" in
|
||||||
[Yy][Ee][Ss])
|
[Yy][Ee][Ss])
|
||||||
print=-print;;
|
print=-print;;
|
||||||
@ -42,8 +46,7 @@ case "$daily_clean_tmps_enable" in
|
|||||||
do
|
do
|
||||||
[ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
|
[ ."${dir#/}" != ."$dir" -a -d $dir ] && cd $dir && {
|
||||||
find -d . -type f $args -delete $print
|
find -d . -type f $args -delete $print
|
||||||
find -d . ! -name . -type d -empty -mtime \
|
find -d . ! -name . -type d $dargs -delete $print
|
||||||
+$daily_clean_tmps_days -delete $print
|
|
||||||
} | sed "s,^\\., $dir,"
|
} | sed "s,^\\., $dir,"
|
||||||
done | tee /dev/stderr | wc -l)
|
done | tee /dev/stderr | wc -l)
|
||||||
[ -z "$print" ] && rc=0
|
[ -z "$print" ] && rc=0
|
||||||
|
Loading…
Reference in New Issue
Block a user