Ticket #26231: daily.slocate

File daily.slocate, 708 bytes (added by quinn@…, 14 years ago)

Full text of /opt/local/etc/daily.slocate

Line 
1#!/bin/sh -
2
3# daily.slocate
4#
5# These are actually lines to put in /etc/daily.local (create it if it doesn't
6# exist) to update the slocate database daily. You can also put the lines in
7# /etc/weekly.local if you want to update the database only weekly.
8# The advantage of .daily files over /etc/daily and /etc/weekly files is that
9# next system update won't discard your changes.
10#
11if [ -x /opt/local/bin/slocate ]; then
12    echo ""
13    echo "Rebuilding slocate database:"
14    if [ -f /opt/local/etc/updatedb.conf ]; then
15                # One day, I'll look at the bug that requires doing cd / when launched
16                # with periodic.
17                (cd / && /opt/local/bin/slocate -u -c)
18        else
19                (cd / && /opt/local/bin/slocate -u)
20        fi
21fi