128263Spst#!/bin/sh - 228263Spst# 350472Speter# $FreeBSD: releng/10.2/etc/periodic/weekly/310.locate 166912 2007-02-23 18:44:20Z remko $ 428263Spst# 528263Spst 661981Sbrian# If there is a global system configuration file, suck it in. 761981Sbrian# 861981Sbrianif [ -r /etc/defaults/periodic.conf ] 961981Sbrianthen 1061981Sbrian . /etc/defaults/periodic.conf 1161981Sbrian source_periodic_confs 1261981Sbrianfi 1328263Spst 1461981Sbriancase "$weekly_locate_enable" in 1561981Sbrian [Yy][Ee][Ss]) 1665843Sbrian echo "" 1765843Sbrian echo "Rebuilding locate database:" 1828263Spst 1965843Sbrian locdb=/var/db/locate.database 2028263Spst 2165843Sbrian touch $locdb && rc=0 || rc=3 2265843Sbrian chown nobody $locdb || rc=3 2365843Sbrian chmod 644 $locdb || rc=3 2461981Sbrian 2565843Sbrian cd / 26166912Sremko echo /usr/libexec/locate.updatedb | nice -n 5 su -fm nobody || rc=3 2765843Sbrian chmod 444 $locdb || rc=3;; 2865843Sbrian 2965843Sbrian *) rc=0;; 3061981Sbrianesac 3165843Sbrian 3265843Sbrianexit $rc 33