#!/usr/bin/ksh # # This script writes lists of EPO rmd files. It is intended to be used when for some # reason the automatic daily write of file names to the database has failed. # ## Set the environment variables # if [[ -z $THMSOC ]] then THMSOC=/disks/socware/thmsoc_dp_current export THMSOC fi . $THMSOC/src/config/soc_it_to_me.config . $THMSOC/src/config/gbo_uc_rmd_mirror.config while read school do schooluc=$(echo $school | awk -F_ '{print $1}') while read path do fileName=${path##*/} schName=$(echo $fileName |awk -F_ '{print substr($1,1,4)}') year=$(echo $fileName | awk -F_ '{print "20"substr($1,5,2)}') month=$(echo $fileName | awk -F_ '{print substr($1,7,2)}') day=$(echo $fileName | awk -F_ '{print substr($1,9,2)}') hr=$(echo $fileName | awk -F_ '{print $3}') mn=$(echo $fileName | awk -F_ '{print substr($4,1,2)}') dataTime="${year}-${month}-${day} ${hr}:${mn}:00" mysql_table_name=gbo_${schName}_rmdfiles fileSize=$(ls -l ${UCB_MIRROR_HOME}/${year}/${month}/${day}/$fileName |awk '{print $5}') processTime=$(date -u '+%Y-%m-%d %T') processCode="HardDrive" echo "$mysql_table_name $dataTime $fileName $processTime $processCode $fileSize" ${PHP_SCRIPTS}/gbo_uc_rmd_mirror.php $mysql_table_name \ $dataTime $fileName $processTime $processCode $fileSize done < /home/thmsoc/lphilpotts_stuff/filelists/${schooluc}_rmd_files done < ${CONFIGDIR}/ucalgary_rmd_site_list.txt exit 0