Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use shell script to delete expired trail files in OGG process

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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) |

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report