]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - etc/periodic/weekly/310.locate
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / etc / periodic / weekly / 310.locate
1 #!/bin/sh -
2 #
3 # $FreeBSD$
4 #
5
6 # If there is a global system configuration file, suck it in.
7 #
8 if [ -r /etc/defaults/periodic.conf ]
9 then
10     . /etc/defaults/periodic.conf
11     source_periodic_confs
12 fi
13
14 case "$weekly_locate_enable" in
15     [Yy][Ee][Ss])
16         echo ""
17         echo "Rebuilding locate database:"
18
19         locdb=/var/db/locate.database
20
21         touch $locdb && rc=0 || rc=3
22         chown nobody $locdb || rc=3
23         chmod 644 $locdb || rc=3
24
25         cd /
26         echo /usr/libexec/locate.updatedb | nice -n 5 su -fm nobody || rc=3
27         chmod 444 $locdb || rc=3;;
28
29     *)  rc=0;;
30 esac
31
32 exit $rc