#!/bin/bash # /dev/mapper/dataVG-reg094.hpc.lsu.edu_etc 1008M 284M 674M 30% /backups/reg094.hpc.lsu.edu/reg094_etc # /dev/mapper/dataVG-reg025.hpc.lsu.edu_home on /backups/reg025.hpc.lsu.edu/reg025_home type ext3 (rw) # fs='reg094.hpc.lsu.edu_etc' # pth='/backups/reg094.hpc.lsu.edu/reg094_etc' # updatedb --database-root ${pth} --output /mnt/var_lib_mlocate/mlocatedb-${fs}.db dt=$(date "+%Y%m%d-%H%M") logdir="/var/log/mlocate" if [[ ! -d ${logdir} ]] then mkdir -p ${logdir} fi logfile="${logdir}/update-${dt}.log" #/backups/reg025.hpc.lsu.edu/reg025_home mount | grep dataVG | awk '{print $3}' | grep backups | while read pth do ## host=$(echo ${pth} | awk -F'/' '{print $3}') ## fsp=$(echo ${pth} | awk -F'_' '{print $2}') ## fs="${host}_${fsp}" date >> ${logfile} echo "updatedb --database-root ${pth} --output ${pth}/mlocate.db" >> ${logfile} updatedb --database-root ${pth} --output ${pth}/mlocate.db >> ${logfile} done