From 4162a5f0f0f57264016788850c6c45b9e3b80028 Mon Sep 17 00:00:00 2001 From: millert <> Date: Sat, 29 Apr 2000 18:45:58 +0000 Subject: [PATCH] Prune /tmp traversal at .X11-unix Since /tmp might be a link to /var/tmp, prune at ssh-* or .X11-unix like the find on /tmp does. --- src/etc/daily | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/etc/daily b/src/etc/daily index 527fb7b5..324b8d09 100644 --- a/src/etc/daily +++ b/src/etc/daily @@ -1,6 +1,6 @@ #!/bin/sh - # -# $OpenBSD: daily,v 1.30 2000/04/28 00:47:55 itojun Exp $ +# $OpenBSD: daily,v 1.31 2000/04/29 18:45:58 millert Exp $ # From: @(#)daily 8.2 (Berkeley) 1/25/94 # PATH=/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin @@ -21,14 +21,16 @@ echo "" echo "Removing scratch and junk files:" if [ -d /tmp -a ! -h /tmp ]; then cd /tmp && { - find -x . -name 'ssh-*' -prune -o -type f -atime +3 -execdir rm -f -- {} \; + find -x . \( -name 'ssh-*' -o -name '.X11-unix' \) -prune -o \ + -type f -atime +3 -execdir rm -f -- {} \; find -x . ! -name . -type d -mtime +1 -execdir rmdir -- {} \; \ >/dev/null 2>&1; } fi if [ -d /var/tmp -a ! -h /var/tmp ]; then cd /var/tmp && { - find -x . ! -name . ! -type d -atime +7 -execdir rm -f -- {} \; + find -x . \( -name 'ssh-*' -o -name '.X11-unix' \) -prune -o \ + ! -type d -atime +7 -execdir rm -f -- {} \; find -x . ! -name . -type d -mtime +1 -execdir rmdir -- {} \; \ >/dev/null 2>&1; } fi