#!/bin/bash

#find . -name *.aud > /tmp/temp.txt
find . -type f -mtime +7 > /tmp/temp.txt
for i in $(cat /tmp/temp.txt)
do
if ! [[ $(lsof | grep /u01/app/oracle/admin/accounts/adump/$i) ]]
then
if [[ $(grep “.aud” $i) ]]
then
mv $i backuplogs
fi
fi
done

#tar -cfz backuplogs/audits_${Dstamp} backuplogs/*.aud
#rm backuplogs/*.aud