Magellan Linux

Annotation of /trunk/man-db/man-db.cron

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2731 - (hide annotations) (download)
Thu Dec 3 10:41:05 2015 UTC (8 years, 11 months ago) by niro
File size: 623 byte(s)
-do not trap exit 255, always exit 0 to fix cron errors and fixed coding style
1 niro 1613 #! /bin/bash
2    
3     if [ -e /etc/conf.d/man-db ]
4     then
5     source /etc/conf.d/man-db
6     fi
7    
8     if [[ ${CRON} = no ]]
9     then
10     exit 0
11     fi
12    
13     renice +19 -p $$ > /dev/null 2>&1
14     ionice -c3 -p $$ > /dev/null 2>&1
15    
16     LOCKFILE="/run/lock/man-db.lock"
17    
18     # the lockfile is not meant to be perfect, it's just in case the
19     # two man-db cron scripts get run close to each other to keep
20     # them from stepping on each other's toes. The worst that will
21     # happen is that they will temporarily corrupt the database
22 niro 2731 [[ -f ${LOCKFILE} ]] && exit 0
23 niro 1613
24 niro 2731 trap "{ rm -f ${LOCKFILE}; exit 0; }" EXIT
25 niro 1613 touch ${LOCKFILE}
26    
27     # create/update the mandb database
28     mandb ${OPTS}
29    
30     exit 0