forked from pool/findutils
This commit is contained in:
parent
170b39e86b
commit
f48c065646
@ -1,81 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# clean_core. This script was split off cron.daily
|
|
||||||
# Please add your local changes to cron.daily.local
|
|
||||||
# since this file will be overwritten, when updating your system.
|
|
||||||
#
|
|
||||||
# Copyright (c) 2006 SuSE Linux Products GmbH, Nuernberg, Germany.
|
|
||||||
#
|
|
||||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
||||||
#
|
|
||||||
# Author: Burchard Steinbild <bs@suse.de>, 1996
|
|
||||||
# Florian La Roche <florian@suse.de>, 1996
|
|
||||||
#
|
|
||||||
#
|
|
||||||
#
|
|
||||||
|
|
||||||
|
|
||||||
#
|
|
||||||
# paranoia settings
|
|
||||||
#
|
|
||||||
umask 022
|
|
||||||
|
|
||||||
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
||||||
export PATH
|
|
||||||
|
|
||||||
#
|
|
||||||
# get configuration
|
|
||||||
#
|
|
||||||
if [ -f /etc/sysconfig/locate ]; then
|
|
||||||
. /etc/sysconfig/locate
|
|
||||||
fi
|
|
||||||
if [ -f /etc/sysconfig/cron ]; then
|
|
||||||
. /etc/sysconfig/cron
|
|
||||||
fi
|
|
||||||
|
|
||||||
#
|
|
||||||
# look for old core files and tell user about it.
|
|
||||||
#
|
|
||||||
if [ -z "$MAX_DAYS_FOR_CORE" ]; then
|
|
||||||
MAX_DAYS_FOR_CORE=5
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -n "$RUN_UPDATEDB" -a "$RUN_UPDATEDB" = yes -a \
|
|
||||||
-x /usr/bin/updatedb ]; then
|
|
||||||
for DUMMY in $(find /var/lib/locatedb -mtime -7 2>/dev/null); do
|
|
||||||
IFS=$'\n'
|
|
||||||
for COREFILE in $(locate '*/core' '*/core.[0-9]*' 2>/dev/null); do
|
|
||||||
for i in $(find "$COREFILE" ! \( -fstype nfs -o -fstype NFS \) \
|
|
||||||
\( -name core -o -regex ".*/core\\.[0-9]+" \) -type f \
|
|
||||||
-mtime +"$MAX_DAYS_FOR_CORE" 2>/dev/null); do
|
|
||||||
if [ -x /usr/bin/file ]; then
|
|
||||||
type=$(/usr/bin/file "$i")
|
|
||||||
case $type in
|
|
||||||
*core\ file*)
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
continue
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
if [ "$DELETE_OLD_CORE" = yes ]; then
|
|
||||||
echo "Deleting core file older than $MAX_DAYS_FOR_CORE days: $i"
|
|
||||||
if [ -x /usr/bin/file ]; then
|
|
||||||
echo file "$i"
|
|
||||||
echo "$type"
|
|
||||||
fi
|
|
||||||
rm -f "$i"
|
|
||||||
else
|
|
||||||
echo "Found core file older than $MAX_DAYS_FOR_CORE days: $i"
|
|
||||||
if [ -x /usr/bin/file ]; then
|
|
||||||
echo file "$i"
|
|
||||||
echo "$type"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
done
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
exit 0
|
|
@ -1,3 +1,8 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Jul 5 18:34:37 CEST 2007 - schwab@suse.de
|
||||||
|
|
||||||
|
- Drop clean core script.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Sun Jun 3 19:48:01 CEST 2007 - schwab@suse.de
|
Sun Jun 3 19:48:01 CEST 2007 - schwab@suse.de
|
||||||
|
|
||||||
|
@ -12,20 +12,18 @@
|
|||||||
|
|
||||||
Name: findutils
|
Name: findutils
|
||||||
URL: http://www.gnu.org/software/findutils/
|
URL: http://www.gnu.org/software/findutils/
|
||||||
License: GNU General Public License (GPL)
|
License: GPL v2 or later
|
||||||
Group: Productivity/File utilities
|
Group: Productivity/File utilities
|
||||||
Provides: find
|
Provides: find
|
||||||
Obsoletes: find
|
Obsoletes: find
|
||||||
Autoreqprov: on
|
Autoreqprov: on
|
||||||
PreReq: %{install_info_prereq}
|
PreReq: %{install_info_prereq}
|
||||||
Version: 4.2.31
|
Version: 4.2.31
|
||||||
Release: 1
|
Release: 12
|
||||||
Summary: GNU find--Finding Files
|
Summary: GNU find--Finding Files
|
||||||
Source: findutils-%{version}.tar.gz
|
Source: findutils-%{version}.tar.gz
|
||||||
Source1: sysconfig.locate
|
Source1: sysconfig.locate
|
||||||
Source2: sysconfig.cron-locate
|
Source2: cron.daily.updatedb
|
||||||
Source3: cron.daily.updatedb
|
|
||||||
Source4: cron.daily.clean_core
|
|
||||||
Patch: findutils-%{version}.diff
|
Patch: findutils-%{version}.diff
|
||||||
Patch2: warn.diff
|
Patch2: warn.diff
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
@ -94,16 +92,13 @@ make install DESTDIR=$RPM_BUILD_ROOT
|
|||||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
|
mkdir -p $RPM_BUILD_ROOT/etc/cron.daily
|
||||||
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
install -m 644 %{SOURCE1} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
||||||
install -m 644 %{SOURCE2} $RPM_BUILD_ROOT/var/adm/fillup-templates
|
install -m 755 %{SOURCE2} $RPM_BUILD_ROOT/etc/cron.daily/suse.de-updatedb
|
||||||
install -m 755 %{SOURCE3} $RPM_BUILD_ROOT/etc/cron.daily/suse.de-updatedb
|
|
||||||
install -m 755 %{SOURCE4} $RPM_BUILD_ROOT/etc/cron.daily/suse.de-clean-core
|
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post locate
|
%post locate
|
||||||
%{fillup_only -n locate}
|
%{fillup_only -n locate}
|
||||||
%{fillup_only -sn cron locate}
|
|
||||||
|
|
||||||
%post
|
%post
|
||||||
%install_info --info-dir=%{_infodir} %{_infodir}/find.info.gz
|
%install_info --info-dir=%{_infodir} %{_infodir}/find.info.gz
|
||||||
@ -133,6 +128,8 @@ rm -rf $RPM_BUILD_ROOT
|
|||||||
/var/adm/fillup-templates/*
|
/var/adm/fillup-templates/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jul 05 2007 - schwab@suse.de
|
||||||
|
- Drop clean core script.
|
||||||
* Sun Jun 03 2007 - schwab@suse.de
|
* Sun Jun 03 2007 - schwab@suse.de
|
||||||
- Update to findutils 4.2.31.
|
- Update to findutils 4.2.31.
|
||||||
** Security Fixes
|
** Security Fixes
|
||||||
|
@ -1,19 +0,0 @@
|
|||||||
## Path: System/Cron
|
|
||||||
## Description: Deleting core files
|
|
||||||
## Type: yesno
|
|
||||||
## Default: no
|
|
||||||
#
|
|
||||||
# Should old corefiles they be deleted? ("yes" or "no")
|
|
||||||
# If set to 'no', cron.daily will tell you if it finds old core files.
|
|
||||||
# NOTE: This feature requires RUN_UPDATEDB to be set to "yes"
|
|
||||||
# and the package with locate (findutils-locate) to be installed.
|
|
||||||
#
|
|
||||||
DELETE_OLD_CORE=no
|
|
||||||
|
|
||||||
## Type: integer
|
|
||||||
## Default: 7
|
|
||||||
#
|
|
||||||
# Maximum age of core files (in days)
|
|
||||||
#
|
|
||||||
MAX_DAYS_FOR_CORE=7
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user