SCIENTIFIC-LINUX-USERS Archives

August 2005

SCIENTIFIC-LINUX-USERS@LISTSERV.FNAL.GOV

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Michael Mansour <[log in to unmask]>
Reply To:
Michael Mansour <[log in to unmask]>
Date:
Thu, 18 Aug 2005 13:11:26 +1000
Content-Type:
text/plain
Parts/Attachments:
text/plain (54 lines)
Hi,

> Michael Mansour wrote:
> > The following is what is run daily in cron:
> > 
> > # cat /etc/cron.daily/slocate.cron
> > #!/bin/sh
> > . /etc/updatedb.conf
> > [ "$DAILY_UPDATE" != "yes" ] && exit 0
> > renice +19 -p $$ >/dev/null 2>&1
> > /usr/bin/updatedb
> > 
> > I don't see any reason why you would want to run it during boot.
> 
> To have an up to date index of files.

I understand, but this has a performance hit on the machine, especially if you
have large filesystems, the last thing you want is for the machine to slow
down when it's just started up. An slocate can take some time to complete
depending on the speed of cpu, drive, etc and it will affect other services
you run on the machine until it completes. This is why it's cron'd to run at
night.

> > If you wish
> > to manually run it at any time, just use:
> > 
> > # updatedb&
> 
> If I make the "$DAILY_UPDATE" = "yes" in the above, will it make 
> updatedb running each time on boot?

You'll notice the cron references the updatedb.conf file:

# cat /etc/updatedb.conf
# To enable the updatedb in cron, set DAILY_UPDATE to yes
DAILY_UPDATE=yes

PRUNEFS="sysfs selinuxfs usbdevfs devpts NFS nfs afs sfs proc smbfs cifs
autofs auto iso9660 udf"
PRUNEPATHS="/tmp /usr/tmp /var/tmp /afs /net /sfs /selinux /udev /mnt/floppy"
export PRUNEFS
export PRUNEPATHS

As you can see, DAILY_UPDATE is already set to yes which means slocate (or
updatedb) will be run each morning (early).

If you really want to run an updatedb on each boot, I suggest you put it into
your /etc/rc.d/rc.local file which gets read as the last rc file after all
other services are started.

But I personally wouldn't do that.

Michael.

ATOM RSS1 RSS2