[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

cron not running script?



hi all,
I have written a cron script to rebuild the glimpse index of the man pages
on my computer that tkman creates. If I run this script as root it works
fine, however, when I put the script in the directory /etc/cron.weekly the
indexes don't get updated. The date on the index files doesn't change. So
my guess is the script isn't even getting run, however, the
makewhatis.cron script in the same directory gets run. I checked the path
settings in /etc/crontab and they are ok. Any ideas? Here is what my
script looks like:

#!/bin/bash
################################################################################
# Runs "glimpseindex" to index man pages
# Tue May  5 15:49:16 UTC 1998
################################################################################

DIR0=`echo "$MANPATH" | awk -F: '{ print $1 }'`
if [ "$DIR0" != "" ]; then
	DIR1=`echo "$MANPATH" | awk -F: '{ print $2 }'`
	if [ "$DIR1" != "" ]; then
		DIR2=`echo "$MANPATH" | awk -F: '{ print $3 }'`
		if [ "$DIR2" != "" ]; then	
			DIR3=`echo "$MANPATH" | awk -F: '{ print $4 }'`
			if [ "$DIR3" != "" ]; then
				DIR4=`echo "$MANPATH" | awk -F: '{ print
$5 }'`
				if [ "$DIR4" != "" ]; then
					DIR5=`echo "$MANPATH" | awk -F: '{
print $6 }'`
					if [ "$DIR5" != "" ]; then
						glimpseindex -o -B -z -H
$DIR5 $DIR5
						cd $DIR5
						chmod 644 .glimpse_*		
					fi
					glimpseindex -o -B -z -H $DIR4
$DIR4
					cd $DIR4
					chmod 644 .glimpse_*
				fi
				glimpseindex -o -B -z -H $DIR3 $DIR3
				cd $DIR3
				chmod 644 .glimpse_*
			fi
			glimpseindex -o -B -z -H $DIR2 $DIR2
			cd $DIR2
			chmod 644 .glimpse_*
		fi
		glimpseindex -o -B -z -H $DIR1 $DIR1
		cd $DIR1
		chmod 644 .glimpse_*
	fi	
	glimpseindex -o -B -z -H $DIR0 $DIR0
	cd $DIR0
	chmod 644 .glimpse_*
fi

exit 0


Thanks,
- Mandarth

CS major at "Southern Polytechnic State University" and Linux enthusiast
Member of the Tenchi Ring, #ASOL#, and #WASHU#
Site Administrator of:
     Ryoko's Hot Spring http://www.inetnow.net/~zappa/index.html  
  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]