How to use shell script to delete expired trail files in OGG process
This article mainly explains "how to use shell script to delete expired trail files in OGG process", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn how to use shell scripts to delete expired trail files from OGG processes.
#! / bin/bash#by raysuen#v02ComGgsci=/u01/ggs/ggsci # specify the absolute path to ggsci ExtractTrailDir=/u01/ggs/dirdat # specify the directory of trail files keepfiles=1 # specify the number of retained files rmlog=/u01/scripts/ray/RmOGGTrail.log # specify the log of the delete script Record and delete those trail files # get all extract process information # # # # getOGGExtractInfo () {${ComGgsci} ${rmlog} # echo "rm-f ${j}" | bash fi done# echo ${arrayExtract [${I}]} done# cycle to determine the specified delivery process Extraction trail file} # of the corresponding extraction process} # get all replicat process information # # # # getOGGReplicatInfo () {${ComGgsci} ${rmlog} # get the name of the replication process and the name of the checkpoint file being read Separate for i in `getOGGReplicatInfo with commas | egrep-v "GGSCI | ^ $" | sed-n'/ REPLICAT/,$p' | awk-v rname= ""'{if ($1 million = "REPLICAT") {rname=$2 Mynum=1} else if (($1 $2 $3) = "LogReadCheckpoint") {print rname "," $5}} '`do # get the leading name replicatFilePre= `echo $I of the trail file of the current replication process | awk-F',''{print $2}'| awk-F'/'- v prefile= ""'{for (iTunes 1i) |