#!/usr/bin/ksh
a=`ps -ef|grep “mv_iotto.ksh”|grep -v grep|wc -l`
if [ $a -gt 2 ]
then
echo “Exiting because of more than 1 Moving archive log script is running ”
exit
fi
for fname in `ls -rlt /tmpdb2/oradata/UOCIOTTO_ARCH/*.arc | awk ‘{print $9}’ | sed ‘$d’ | sed ‘$d’`
do
print “”;
print “File Name : $fname “;
dest_file=`echo $fname| cut -c31-80`;
print “dest_file = $dest_file”;
dest_file_with_path=”/tmpdb4/oradata/UOCIOTTO_ARCH/$dest_file”;
print “dest file with path = $dest_file_with_path”;
print “Processing mv $fname $dest_file_with_path…..”;
mv $fname $dest_file_with_path;
print “Processing gzip $dest_file_with_path…..”;
gzip $dest_file_with_path;
done