summaryrefslogtreecommitdiffstats
path: root/etc
diff options
context:
space:
mode:
authorjoerg <joerg@FreeBSD.org>1999-03-21 12:34:06 +0000
committerjoerg <joerg@FreeBSD.org>1999-03-21 12:34:06 +0000
commitefd64fb913db617ec94b869ba8fb3718be36d0de (patch)
treeb9cd83209539ff58fd9d74cb825a40feebefa17f /etc
parent7bd71ddeb6bcaa152508dead2976597dc61d52fe (diff)
downloadFreeBSD-src-efd64fb913db617ec94b869ba8fb3718be36d0de.zip
FreeBSD-src-efd64fb913db617ec94b869ba8fb3718be36d0de.tar.gz
Finally remove the ancient `-exec rm -f {} ;' cruft that used to be
used to cleanup old files, and replace it by -delete which has been present in our find(1) for ages now.
Diffstat (limited to 'etc')
-rwxr-xr-xetc/periodic/daily/100.clean-disks8
-rwxr-xr-xetc/periodic/daily/110.clean-tmps17
-rwxr-xr-xetc/periodic/daily/120.clean-preserve4
-rwxr-xr-xetc/periodic/daily/140.clean-rwho4
-rwxr-xr-xetc/periodic/weekly/120.clean-kvmdb4
5 files changed, 13 insertions, 24 deletions
diff --git a/etc/periodic/daily/100.clean-disks b/etc/periodic/daily/100.clean-disks
index 0df987d..6903894 100755
--- a/etc/periodic/daily/100.clean-disks
+++ b/etc/periodic/daily/100.clean-disks
@@ -1,10 +1,6 @@
#!/bin/sh
#
-# $Id: 100.clean-disks,v 1.1.1.1 1997/08/12 17:51:15 pst Exp $
-#
-# This is a security hole, never use 'find' on a public directory
-# with -exec rm -f as root. This can be exploited to delete any file
-# on the system.
+# $Id: 100.clean-disks,v 1.1.1.1 1997/08/16 17:04:00 pst Exp $
#
exit 0 # do not run by default
@@ -12,4 +8,4 @@ exit 0 # do not run by default
find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \
\( -name '[#,]*' -o -name '.#*' -o -name a.out -o -name '*.core' \
-o -name '*.CKP' -o -name '.emacs_[0-9]*' \) \
- -a -atime +3 -exec rm -f -- {} \;
+ -a -atime +3 -delete
diff --git a/etc/periodic/daily/110.clean-tmps b/etc/periodic/daily/110.clean-tmps
index 86abc4c..21fbada 100755
--- a/etc/periodic/daily/110.clean-tmps
+++ b/etc/periodic/daily/110.clean-tmps
@@ -1,10 +1,6 @@
#!/bin/sh
#
-# $Id: 110.clean-tmps,v 1.2 1997/09/01 11:07:55 ache Exp $
-#
-# This is a security hole, never use 'find' on a public directory
-# with -exec rm -f as root. This can be exploited to delete any file
-# on the system.
+# $Id: 110.clean-tmps,v 1.3 1997/09/11 15:21:30 ache Exp $
#
# Use at your own risk, but for a long-living system, this might come
# more useful than the boot-time cleaning of /tmp. If /var/tmp and
@@ -16,17 +12,14 @@ exit 0 # do not run by default
if [ -d /tmp ]; then
cd /tmp && {
- find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' \
- -exec rm -f -- {} \;
- find -d . ! -name . -type d -mtime +1 -exec rmdir -- {} \; \
- >/dev/null 2>&1
+ find . -type f -atime +3 -ctime +3 ! -name '.X*-lock' -delete
+ find -d . ! -name . -type d -mtime +1 -delete
}
fi
if [ -d /var/tmp ]; then
cd /var/tmp && {
- find . ! -name . -atime +7 -ctime +3 -exec rm -f -- {} \;
- find -d . ! -name . ! -name vi.recover -type d -mtime +1 -exec rmdir -- {} \; \
- >/dev/null 2>&1
+ find . ! -name . -atime +7 -ctime +3 -delete
+ find -d . ! -name . ! -name vi.recover -type d -mtime +1 -delete
}
fi
diff --git a/etc/periodic/daily/120.clean-preserve b/etc/periodic/daily/120.clean-preserve
index 1a00c12..a780f6f 100755
--- a/etc/periodic/daily/120.clean-preserve
+++ b/etc/periodic/daily/120.clean-preserve
@@ -1,11 +1,11 @@
#!/bin/sh
#
-# $Id: 120.clean-preserve,v 1.1.1.1 1997/08/16 17:04:00 pst Exp $
+# $Id: 120.clean-preserve,v 1.2 1997/08/17 17:55:29 pst Exp $
#
if [ -d /var/preserve ]; then
echo ""
echo "Removing stale files from /var/preserve:"
- cd /var/preserve && find . ! -name . -mtime +7 -exec rm -f -- {} \;
+ cd /var/preserve && find . ! -name . -mtime +7 -delete
fi
diff --git a/etc/periodic/daily/140.clean-rwho b/etc/periodic/daily/140.clean-rwho
index f9261e3..b89a7c2 100755
--- a/etc/periodic/daily/140.clean-rwho
+++ b/etc/periodic/daily/140.clean-rwho
@@ -1,12 +1,12 @@
#!/bin/sh
#
-# $Id: 140.clean-rwho,v 1.1.1.1 1997/08/16 17:04:00 pst Exp $
+# $Id: 140.clean-rwho,v 1.2 1997/08/17 17:55:30 pst Exp $
#
if [ -d /var/rwho ] ; then
echo ""
echo "Removing stale files from /var/rwho:"
- cd /var/rwho && find . ! -name . -mtime +7 -exec rm -f -- {} \;
+ cd /var/rwho && find . ! -name . -mtime +7 -delete
fi
diff --git a/etc/periodic/weekly/120.clean-kvmdb b/etc/periodic/weekly/120.clean-kvmdb
index 69eed4a..abf00cd 100755
--- a/etc/periodic/weekly/120.clean-kvmdb
+++ b/etc/periodic/weekly/120.clean-kvmdb
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $Id: 120.clean-kvmdb,v 1.1.1.1 1997/08/16 17:04:02 pst Exp $
+# $Id: 120.clean-kvmdb,v 1.2 1998/01/01 09:04:47 bde Exp $
#
if [ -d /var/db ] ; then
@@ -11,5 +11,5 @@ if [ -d /var/db ] ; then
kernel=kvm_`basename ${kernel}`.db
find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a \
- -atime +7 -exec rm -f -- {} \;
+ -atime +7 -delete
fi
OpenPOWER on IntegriCloud