Pull up following revision(s) (requested by christos in ticket #456): netbsd-6
authormartin <martin@NetBSD.org>
Wed, 08 Aug 2012 14:26:49 +0000
branchnetbsd-6
changeset 256025 8f7987422ece
parent 256024 f78c0d2c4f24
child 256026 d03a04d4d22f
Pull up following revision(s) (requested by christos in ticket #456): etc/daily: revision 1.82 etc/defaults/daily.conf: revision 1.17 share/man/man5/daily.5: revision 1.5 PR/46756: Edgar Fuß: Enable ignoring subdirectories in daily's find_core
etc/daily
etc/defaults/daily.conf
share/man/man5/daily.5
--- a/etc/daily	Wed Aug 08 09:02:14 2012 +0000
+++ b/etc/daily	Wed Aug 08 14:26:49 2012 +0000
@@ -1,6 +1,6 @@
 #!/bin/sh -
 #
-#	$NetBSD: daily,v 1.80.2.1 2012/02/16 19:56:43 riz Exp $
+#	$NetBSD: daily,v 1.80.2.2 2012/08/08 14:26:49 martin Exp $
 #	@(#)daily	8.2 (Berkeley) 1/25/94
 #
 
@@ -89,7 +89,16 @@
 	ignfstypes="$(echo $find_core_ignore_fstypes | \
 		sed -e's/\(!*\)\([^[:space:]]\{1,\}\)/-o \1 -fstype \2/g' \
 		    -e's/^-o //')"
+	# Turn "foo bar" into "( -path foo -o -path bar ) -prune -o"
+	# Set ignpaths empty if no find_core_ignore_paths given
+	if [ -n "$find_core_ignore_paths" ]; then
+		ignpaths="$(printf " -o -path %s" $find_core_ignore_paths)"
+		ignpaths="( ${ignpaths# -o } ) -prune -o"
+	else
+		ignpaths=""
+	fi
 	find / \( $ignfstypes \) -prune -o \
+		${ignpaths} \
 		-name 'lost+found' -prune -o \
 		\( -name '*.core' -o -name 'core' \) -type f -print > $TMP
 #		\( -name '[#,]*' -o -name '.#*' -o -name a.out \
--- a/etc/defaults/daily.conf	Wed Aug 08 09:02:14 2012 +0000
+++ b/etc/defaults/daily.conf	Wed Aug 08 14:26:49 2012 +0000
@@ -1,4 +1,4 @@
-#	$NetBSD: daily.conf,v 1.16 2012/02/07 19:13:30 joerg Exp $
+#	$NetBSD: daily.conf,v 1.16.2.1 2012/08/08 14:26:49 martin Exp $
 #
 # /etc/defaults/daily.conf --
 #	default configuration of /etc/daily.conf
@@ -11,6 +11,7 @@
 
 find_core=YES
 find_core_ignore_fstypes="!local rdonly fdesc null kernfs procfs ptyfs"
+find_core_ignore_paths=""
 expire_news=NO
 purge_accounting=YES
 run_msgs=YES
--- a/share/man/man5/daily.5	Wed Aug 08 09:02:14 2012 +0000
+++ b/share/man/man5/daily.5	Wed Aug 08 14:26:49 2012 +0000
@@ -1,4 +1,4 @@
-.\"	$NetBSD: daily.5,v 1.3.6.1 2012/03/08 17:51:39 riz Exp $
+.\"	$NetBSD: daily.5,v 1.3.6.2 2012/08/08 14:26:49 martin Exp $
 .\"
 .\" Copyright (c) 1996 Matthew R. Green
 .\" All rights reserved.
@@ -24,7 +24,7 @@
 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\" SUCH DAMAGE.
 .\"
-.Dd March 6, 2012
+.Dd July 30, 2012
 .Dt DAILY 5
 .Os
 .Sh NAME
@@ -168,6 +168,16 @@
 .Ql procfs
 type filesystems and filesystems that are not
 .Ql local .
+.It Sy find_core_ignore_paths
+Lists paths to ignore during the
+.Sy find_core
+phase.
+For example,
+.Ql /export
+will not descend into any directories under the
+.Ql /export
+hierarchy. This, on a file server, allows to skip
+user data while still scanning system files.
 .It Sy run_fsck_flags
 Extra options to be passed to
 .Xr fsck 8