Module Name: src Committed By: christos Date: Mon Jul 30 17:06:51 UTC 2012
Modified Files: src/etc: daily src/etc/defaults: daily.conf src/share/man/man5: daily.5 Log Message: PR/46756: Edgar Fu�: Enable ignoring subdirectories in daily's find_core To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/etc/daily cvs rdiff -u -r1.16 -r1.17 src/etc/defaults/daily.conf cvs rdiff -u -r1.4 -r1.5 src/share/man/man5/daily.5 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/etc/daily diff -u src/etc/daily:1.81 src/etc/daily:1.82 --- src/etc/daily:1.81 Wed Feb 15 18:30:11 2012 +++ src/etc/daily Mon Jul 30 13:06:51 2012 @@ -1,6 +1,6 @@ #!/bin/sh - # -# $NetBSD: daily,v 1.81 2012/02/15 23:30:11 joerg Exp $ +# $NetBSD: daily,v 1.82 2012/07/30 17:06:51 christos Exp $ # @(#)daily 8.2 (Berkeley) 1/25/94 # @@ -89,7 +89,16 @@ if checkyesno find_core; then 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 \ Index: src/etc/defaults/daily.conf diff -u src/etc/defaults/daily.conf:1.16 src/etc/defaults/daily.conf:1.17 --- src/etc/defaults/daily.conf:1.16 Tue Feb 7 14:13:30 2012 +++ src/etc/defaults/daily.conf Mon Jul 30 13:06:51 2012 @@ -1,4 +1,4 @@ -# $NetBSD: daily.conf,v 1.16 2012/02/07 19:13:30 joerg Exp $ +# $NetBSD: daily.conf,v 1.17 2012/07/30 17:06:51 christos 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 Index: src/share/man/man5/daily.5 diff -u src/share/man/man5/daily.5:1.4 src/share/man/man5/daily.5:1.5 --- src/share/man/man5/daily.5:1.4 Tue Mar 6 05:12:59 2012 +++ src/share/man/man5/daily.5 Mon Jul 30 13:06:51 2012 @@ -1,4 +1,4 @@ -.\" $NetBSD: daily.5,v 1.4 2012/03/06 10:12:59 plunky Exp $ +.\" $NetBSD: daily.5,v 1.5 2012/07/30 17:06:51 christos 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 @@ will ignore .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