i.cronroot revision 7c478bd95313f5f23a4c958a745db2134aa03244
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# CDDL HEADER START
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# The contents of this file are subject to the terms of the
cbc61fcb33b370d049c16a3c44568b4deb4e2b33Timo Sirainen# Common Development and Distribution License, Version 1.0 only
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# (the "License"). You may not use this file except in compliance
00d58fcfe8191d6ce7efa801d289a5c0fe88d1aeTimo Sirainen# with the License.
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# See the License for the specific language governing permissions
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# and limitations under the License.
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# When distributing Covered Code, include this CDDL HEADER in each
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen# If applicable, add the following below this CDDL HEADER, with the
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen# fields enclosed by brackets "[]" replaced with your own identifying
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen# information: Portions Copyright [yyyy] [name of copyright owner]
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# CDDL HEADER END
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen#ident "%Z%%M% %I% %E% SMI"
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# Use is subject to license terms.
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# The rtc command is run to adjust the real time clock if and when
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen# daylight savings time changes.
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen1 2 * * * [ -x /usr/sbin/rtc ] && /usr/sbin/rtc -c > /dev/null 2>&1'
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen if [ ! -f $dest ] ; then
8e371a3ce32bd64288786855b8ce0cb63f19f7d1Timo Sirainen # add rtc into root crontab entry
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # 2.1 version of this file had a trailing blank line.
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen sed -e '$s/^[ ]*$/%%%/' -e '/^%%%$/d' $dest > /tmp/d.$$
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # use nfsfind and reduce frequency from everyday to once a week
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # without overriding the local admins changes
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainen sed -e 's,find / -name \.nfs\\\* -mtime +7.*,/usr/lib/fs/nfs/nfsfind,' \
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen -e 's,\* \* \* /usr/lib/fs/nfs/nfsfind,\* \* 0 /usr/lib/fs/nfs/nfsfind,' $dest > /tmp/d.$$
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # logchecker goes away
cbc61fcb33b370d049c16a3c44568b4deb4e2b33Timo Sirainen sed -e '/[^#]*[ ]*\/etc\/cron.d\/logchecker/d' $dest > /tmp/d.$$
cbc61fcb33b370d049c16a3c44568b4deb4e2b33Timo Sirainen # newsyslog goes away if the entry hasn't been modifed
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen sed -e '/10 3 \* \* 0[ ]*\/usr\/lib\/newsyslog/d' $dest > /tmp/d.$$
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # add logadm command
e07bf3772a2bc075de4915ad0961beb8d083c22dTimo Sirainen if [ $? != 0 ] ; then
cbc61fcb33b370d049c16a3c44568b4deb4e2b33Timo Sirainen # add rtc entry if its missing for i386
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # delete rtc entry for sparc and other ARCH
e07bf3772a2bc075de4915ad0961beb8d083c22dTimo Sirainen if [ $? != 0 ] ; then
b04e691711fd026fc82ba3e0b411420e7da4ec7eTimo Sirainen if [ $? = 0 ] ; then
4d2211dac61c615c5bdfd501ea54d46c89d41b0fTimo Sirainen -e '/^# The rtc command is run/,/^#$/d' \
eddd9bf1a1369aea4a2715f6be1137da6d17d293Timo Sirainen# rm -f /tmp/d.$$ /tmp/newident.$$ /tmp/rest.$$
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # take nptdate out of crontab. It was added in Beta 2.6.
e07bf3772a2bc075de4915ad0961beb8d083c22dTimo Sirainen # Make sure it is gone evermore.
e07bf3772a2bc075de4915ad0961beb8d083c22dTimo Sirainen grep "/usr/lib/inet/ntpdate" $dest >/dev/null 2>&1
73b50eecfc31750a312e2f940023f522eb07178cTimo Sirainen /^.*\/usr\/lib\/inet\/ntpdate.*$/ {
eddd9bf1a1369aea4a2715f6be1137da6d17d293Timo Sirainen # ftpclean was added in 2.7 (pre-beta) but will
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen # not be shipping in 2.7. Remove cron entry
d66be2bebfa96e7d3d20e2153f60e6e25dcc9a18Timo Sirainen grep "/usr/lib/inet/ftpclean" $dest >/dev/null 2>&1
cf7164ece50797a67fc4bfb5889022ac93a36a8aTimo Sirainen sed -e '/^.*\/usr\/lib\/inet\/ftpclean.*$/d' $dest >/tmp/cron.$$
783278c012551bc2f25f065a8d3ec1a3cfc0d296Timo Sirainen # add gsscred duplicates clean-up script - SUNWgss
d66be2bebfa96e7d3d20e2153f60e6e25dcc9a18Timo Sirainen grep "/usr/lib/gss/gsscred_clean" $dest >/dev/null 2>&1
cbc61fcb33b370d049c16a3c44568b4deb4e2b33Timo Sirainen if [ $? != 0 ] ; then