diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2020-10-08 12:08:46 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2020-10-08 12:08:46 +0000 |
commit | aca2a0f3eb12d840af511d9ce91fd53996f374c7 (patch) | |
tree | 0b4a0c4fc22d6364d0907d77fd4f917c1a73038e | |
parent | 3f805fa312e3cc240af964b5c1bb710d537d31a9 (diff) |
Use find -delete instead of execing rm and rmdir.
OK sthen@ denis@
-rw-r--r-- | etc/daily | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/daily b/etc/daily index a3d89391a25..e51412674de 100644 --- a/etc/daily +++ b/etc/daily @@ -1,5 +1,5 @@ # -# $OpenBSD: daily,v 1.93 2019/09/09 20:02:26 bluhm Exp $ +# $OpenBSD: daily,v 1.94 2020/10/08 12:08:45 millert Exp $ # From: @(#)daily 8.2 (Berkeley) 1/25/94 # # For local additions, create the file /etc/daily.local. @@ -50,17 +50,17 @@ if [ -d /tmp -a ! -L /tmp ]; then find -x . \ \( -path './ssh-*' -o -path ./.X11-unix -o -path ./.ICE-unix \ -o -path './tmux-*' \) \ - -prune -o -type f -atime +7 -execdir rm -f -- {} \; 2>/dev/null + -prune -o -type f -atime +7 -delete 2>/dev/null find -x . -type d -mtime +1 ! -path ./vi.recover ! -path ./.X11-unix \ ! -path ./.ICE-unix ! -name . \ - -execdir rmdir -- {} \; >/dev/null 2>&1; } + -delete >/dev/null 2>&1; } fi # Additional junk directory cleanup would go like this: #if [ -d /scratch -a ! -L /scratch ]; then # cd /scratch && { -# find . ! -name . -atime +1 -execdir rm -f -- {} \; -# find . ! -name . -type d -mtime +1 -execdir rmdir -- {} \; \ +# find . ! -name . -atime +1 -delete +# find . ! -name . -type d -mtime +1 -delete \ # >/dev/null 2>&1; } #fi |