aboutsummaryrefslogtreecommitdiff
path: root/etc/periodic/weekly/120.clean-kvmdb
diff options
context:
space:
mode:
Diffstat (limited to 'etc/periodic/weekly/120.clean-kvmdb')
-rwxr-xr-xetc/periodic/weekly/120.clean-kvmdb15
1 files changed, 15 insertions, 0 deletions
diff --git a/etc/periodic/weekly/120.clean-kvmdb b/etc/periodic/weekly/120.clean-kvmdb
new file mode 100755
index 000000000000..24d8aa2b904a
--- /dev/null
+++ b/etc/periodic/weekly/120.clean-kvmdb
@@ -0,0 +1,15 @@
+#!/bin/sh -
+#
+# $Id: 120.clean-kvmdb,v 1.1.1.1 1997/08/12 17:51:16 pst Exp $
+#
+
+if [ -d /var/db -a -x /usr/sbin/sysctl ] ; then
+ echo ""
+ echo "Cleaning up kernel database files:"
+
+ kernel=`sysctl -n kern.bootfile`
+ kernel=kvm_`basename ${kernel}`.db
+
+ find /var/db -name "kvm_*.db" -a ! -name ${kernel} -a \
+ -atime +7 -exec rm -f -- {} \;
+fi