Question : Find command Solairs

Hello,
I have to clean up some oracle log, that are more that 30day old, add to a file, compress the file and the use logadm to keep a number of them
I have written this so far, but the tar part does not seem to work....

thanks
R
$i=oracle_home
        j=0
        while [[ $j -lt 10 ]];
        find /$i/admin/adump -name "*_$j.aud" -mtime +31 -exec sh -c ' tar -rvf file.tar $i ; rm $i ' {} {} \;
        done
echo "" > /tmp/admin
logadm -f /tmp/admin file.tar

Answer : Find command Solairs

Oops. That wont work.

Try this.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
ORA=$ORACLE_HOME
j=0

for i in `find /$ORA/admin/adump -type f -name "*_$j.aud" -mtime +31`
  do
   # Echo the find results to make sure it finds the correct files before you enable the rest.
   echo $i
   #tar -rvf file.tar $i
   #rm $i
  done
Random Solutions  
 
programming4us programming4us