amhost wrote:
<< slocate >>
#!/bin/sh
# remove this to enable updating of updatedb
exit
renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net"
<<makewhatis>>
#!/bin/bash
LOCKFILE=/var/lock/makewhatis.lock
# the lockfile is not meant to be perfect, it's just in case the
# two makewhatis cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will
# happen is that they will temporarily corrupt the database...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -w
exit 0
===========================================
Ok, here are the contents of those files. Remember, i'm a complete n00b, how should I edit this configuration so that the cron job runs earlier.
Thanks for all your help
You don't edit the script, you just run it. cron will run the script once a week; if you want the same results (i.e. the building up of the databases) to happen now instead of in a week, then you can just run these scripts now instead of waiting for cron to do it (cron will still do it in a week too).
Just run the files, like:
bash$ /etc/cron.weekly/slocate
(watch its output, make sure everything was OK)
bash$ /etc/cron.weekly/makewhatis
(watch its output, make sure everything was OK)
You'll probably need to be logged in as root for these scripts to be able to do what they need to do.