diff options
author | Brian Somers <brian@FreeBSD.org> | 2000-06-23 01:18:31 +0000 |
---|---|---|
committer | Brian Somers <brian@FreeBSD.org> | 2000-06-23 01:18:31 +0000 |
commit | f3e285ba7d9ba652ea61d3aca42e6b649ae9e981 (patch) | |
tree | 1d45e43f3d06b437f0125de60d0841c0cd040b70 /etc/periodic/weekly | |
parent | 32ee60d7b865fd8b10a81a24f1a570261af2562a (diff) | |
download | src-f3e285ba7d9ba652ea61d3aca42e6b649ae9e981.tar.gz src-f3e285ba7d9ba652ea61d3aca42e6b649ae9e981.zip |
Introduce /etc/defaults/periodic.conf, similar in concept to rc.conf.
The only change in the default functionality should be that
the output reports are slightly more verbose WRT files deleted.
Not objected to by: freebsd-arch
Notes
Notes:
svn path=/head/; revision=61981
Diffstat (limited to 'etc/periodic/weekly')
-rwxr-xr-x | etc/periodic/weekly/120.clean-kvmdb | 34 | ||||
-rwxr-xr-x | etc/periodic/weekly/300.uucp | 22 | ||||
-rwxr-xr-x | etc/periodic/weekly/310.locate | 32 | ||||
-rwxr-xr-x | etc/periodic/weekly/320.whatis | 56 | ||||
-rwxr-xr-x | etc/periodic/weekly/330.catman | 62 | ||||
-rw-r--r-- | etc/periodic/weekly/340.noid | 23 | ||||
-rwxr-xr-x | etc/periodic/weekly/999.local | 25 |
7 files changed, 174 insertions, 80 deletions
diff --git a/etc/periodic/weekly/120.clean-kvmdb b/etc/periodic/weekly/120.clean-kvmdb index 42079c28089d..dbc8f4e444bb 100755 --- a/etc/periodic/weekly/120.clean-kvmdb +++ b/etc/periodic/weekly/120.clean-kvmdb @@ -3,13 +3,31 @@ # $FreeBSD$ # -if [ -d /var/db ] ; then - echo "" - echo "Cleaning up kernel database files:" +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ]; then + . /etc/defaults/periodic.conf + source_periodic_confs +fi - kernel=`sysctl -n kern.bootfile` - kernel=kvm_`basename ${kernel}`.db +case "$weekly_clean_kvmdb_enable" in + [Yy][Ee][Ss]) + if [ -d /var/db -a -n "$weekly_clean_kvmdb_days" ] + then + echo "" + echo "Cleaning up kernel database files:" - find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a \ - -atime +7 -delete -fi + kernel=`sysctl -n kern.bootfile` + kernel=kvm_${kernel##*/}.db + + case "$weekly_clean_kvmdb_verbose" in + [Yy][Ee][Ss]) + print=-print;; + *) + print=;; + esac + + find /var/db -name "kvm_*.db" ! -name $kernel \ + -atime +$weekly_clean_kvmdb_days -delete $print + fi;; +esac diff --git a/etc/periodic/weekly/300.uucp b/etc/periodic/weekly/300.uucp index eb915044d32b..3370158805ad 100755 --- a/etc/periodic/weekly/300.uucp +++ b/etc/periodic/weekly/300.uucp @@ -5,9 +5,21 @@ # This is really here for backwards compatibility, clean.weekly is not # created by default anymore. -if [ -d /var/spool/uucp -a -f /usr/libexec/uucp/clean.weekly ]; then - echo "" - echo "Cleaning up UUCP:" - - echo /usr/libexec/uucp/clean.weekly | su daemon +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs fi + +case "$weekly_uucp_enable" in + [Yy][Ee][Ss]) + if [ -d /var/spool/uucp -a -f /usr/libexec/uucp/clean.weekly ] + then + echo "" + echo "Cleaning up UUCP:" + + echo /usr/libexec/uucp/clean.weekly | su daemon + fi;; +esac diff --git a/etc/periodic/weekly/310.locate b/etc/periodic/weekly/310.locate index b616a4ab4573..53d3d8001641 100755 --- a/etc/periodic/weekly/310.locate +++ b/etc/periodic/weekly/310.locate @@ -2,16 +2,30 @@ # # $FreeBSD$ # -locdb=/var/db/locate.database -if [ -x /usr/libexec/locate.updatedb -a -f $locdb ] ; then +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi - echo "" - echo "Rebuilding locate database:" +case "$weekly_locate_enable" in + [Yy][Ee][Ss]) + if [ -x /usr/libexec/locate.updatedb -a -f $locdb ] + then + echo "" + echo "Rebuilding locate database:" - touch ${locdb}; chown nobody ${locdb}; chmod 644 ${locdb} + locdb=/var/db/locate.database - cd / - echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody - chmod 444 ${locdb} -fi + touch $locdb + chown nobody $locdb + chmod 644 $locdb + + cd / + echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody + chmod 444 $locdb + fi;; +esac diff --git a/etc/periodic/weekly/320.whatis b/etc/periodic/weekly/320.whatis index 34363318698b..123be9670d7b 100755 --- a/etc/periodic/weekly/320.whatis +++ b/etc/periodic/weekly/320.whatis @@ -3,28 +3,44 @@ # $FreeBSD$ # -if [ -x /usr/libexec/makewhatis.local -a -x /usr/bin/manpath ]; then +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi - echo "" - echo "Rebuilding whatis database:" +case "$weekly_whatis_enable" in + [Yy][Ee][Ss]) + if [ -x /usr/libexec/makewhatis.local -a -x /usr/bin/manpath ] + then + echo "" + echo "Rebuilding whatis database:" - MANPATH=`/usr/bin/manpath -q` - if [ $? = 0 ]; then - if [ "x${MANPATH}" = "x" ]; then - echo "manpath failed to find any manpage directories" - else - man_locales=`/usr/bin/manpath -qL` + MANPATH=`/usr/bin/manpath -q` + if [ $? = 0 ] + then + if [ "x${MANPATH}" = "x" ] + then + echo "manpath failed to find any manpage directories" + else + man_locales=`/usr/bin/manpath -qL` - # Build whatis(1) database(s) for original, non-localized manpages. - /usr/libexec/makewhatis.local "${MANPATH}" + # Build whatis(1) database(s) for original, non-localized + # manpages. + /usr/libexec/makewhatis.local "${MANPATH}" - # Build whatis(1) database(s) for localized manpages. - if [ X"${man_locales}" != X ]; then - for i in ${man_locales} - do - LC_CTYPE=$i /usr/libexec/makewhatis.local -a -L "${MANPATH}" - done + # Build whatis(1) database(s) for localized manpages. + if [ X"${man_locales}" != X ] + then + for i in ${man_locales} + do + LC_CTYPE=$i /usr/libexec/makewhatis.local -a \ + -L "${MANPATH}" + done + fi + fi fi - fi - fi -fi + fi;; +esac diff --git a/etc/periodic/weekly/330.catman b/etc/periodic/weekly/330.catman index a2a6a8ee8e2a..e446dd22662c 100755 --- a/etc/periodic/weekly/330.catman +++ b/etc/periodic/weekly/330.catman @@ -3,32 +3,44 @@ # $FreeBSD$ # -exit 0 # do not run by default +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi -if [ -x /usr/libexec/catman.local \ - -a -d /usr/share/man/cat1 \ - -a -x /usr/bin/manpath ]; then - echo "" - echo "Reformatting manual pages:" +case "$weekly_catman_enable" in + [Yy][Ee][Ss]) + if [ -x /usr/libexec/catman.local -a -d /usr/share/man/cat1 -a \ + -x /usr/bin/manpath ] + then + echo "" + echo "Reformatting manual pages:" - MANPATH=`/usr/bin/manpath -q` - if [ $? = 0 ]; then - if [ "x${MANPATH}" = "x" ]; then - echo "manpath failed to find any manpath directories" - else - man_locales=`/usr/bin/manpath -qL` + MANPATH=`/usr/bin/manpath -q` + if [ $? = 0 ] + then + if [ "x${MANPATH}" = "x" ] + then + echo "manpath failed to find any manpath directories" + else + man_locales=`/usr/bin/manpath -qL` - # Preformat original, non-localized manpages - echo /usr/libexec/catman.local "${MANPATH}" | su -fm man + # Preformat original, non-localized manpages + echo /usr/libexec/catman.local "$MANPATH" | su -fm man - # Preformat localized manpages. - if [ X"${man_locales}" != X ]; then - for i in ${man_locales} - do - LC_CTYPE=$i echo /usr/libexec/catman.local -L "${MANPATH}" | \ - su -fm man - done - fi - fi - fi -fi + # Preformat localized manpages. + if [ X"$man_locales" != X ] + then + for i in $man_locales + do + LC_CTYPE=$i echo /usr/libexec/catman.local -L \ + "$MANPATH" | su -fm man + done + fi + fi + fi + fi;; +esac diff --git a/etc/periodic/weekly/340.noid b/etc/periodic/weekly/340.noid index 8a94924b6703..7ad71ea07f57 100644 --- a/etc/periodic/weekly/340.noid +++ b/etc/periodic/weekly/340.noid @@ -1,14 +1,21 @@ #!/bin/sh - # # $FreeBSD$ +# -exit 0 # do not run by default - -echo "" -echo "Check for files belongs to an unknown user or unknown group:" - -# directories to be verified -: ${NOIDSEARCHPATHS="/"} +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs +fi -find -H $NOIDSEARCHPATHS -fstype local \( -nogroup -or -nouser \) -print +case "$weekly_noid_enable" in + [Yy][Ee][Ss]) + echo "" + echo "Check for files with an unknown user or group:" + find -H ${weekly_noid_dirs:-/} -fstype local \ + \( -nogroup -o -nouser \) -print | sed 's/^/ /';; +esac diff --git a/etc/periodic/weekly/999.local b/etc/periodic/weekly/999.local index bc9fac288c04..efab6f4b25d8 100755 --- a/etc/periodic/weekly/999.local +++ b/etc/periodic/weekly/999.local @@ -3,9 +3,24 @@ # $FreeBSD$ # -if [ -f /etc/weekly.local ]; then - echo "" - echo "Running weekly.local:" - - sh /etc/weekly.local +# If there is a global system configuration file, suck it in. +# +if [ -r /etc/defaults/periodic.conf ] +then + . /etc/defaults/periodic.conf + source_periodic_confs fi + +for script in $weekly_local +do + case "$script" in + /*) + if [ -f "$script" ] + then + echo "" + echo "Running $script:" + + sh $script + fi;; + esac +done |