#!/bin/ksh #---------------------------------------------------- # To make sure files are archived and there are not # any older files remaining the main SPAN directories. # # Search files down parent tree to do this. # Just change mmdd business date egrep values. #---------------------------------------------------- yearmm=`date "+%Y%m"` ;export yearmm ARCHIVE_DATETIME=`date "+%Y%m%d_%H:%M:%S"` ;export ARCHIVE_DATETIME logFile=/www/ftp/pub/span/data/.archive_scripts/log/check_files_after_archive.$yearmm.log echo "$ARCHIVE_DATETIME ------------------------------------" >> $logFile cd /www/ftp/pub/span/data dirList=`find . -maxdepth 7 -type d -exec ls -d {} \; ` for i in `echo $dirList` do # do not want to check files that were archived cnt=`echo $i | egrep -c '(199|20)' ` echo $i | tee -a $logFile if test $cnt -eq 0; then ls -l $i/*010[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*020[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*030[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*040[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*050[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*060[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*070[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*080[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*090[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*100[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*110[1-3]*.* 2>/dev/null | tee -a $logFile ls -l $i/*120[1-3]*.* 2>/dev/null | tee -a $logFile fi done