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

OGG Operation and maintenance Optimization script (7)-Information Modification Class-Quick comments

2025-04-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

File name: note.sh

Path: $HOME/ggscript/ggnote

Function: this script is used to comment on the configuration table of the specified line, and is used in conjunction with the duplicate value checking script repeat.sh

Initialize the .profile or .bash _ profile file through alias, and use the command note

Log path: $HOME/gglog/ggnote

#! / bin/bash# parameter verification # format is if [$#-eq 0]; then echo "note EXTRACT rowsnum" exit 2fiif [$#-eq 1]; then echo "note EXTRACT rowsnum" exit 2fibackuptime = `date +% Y% m% dmurf% H% M`datenow = `date +% Y% m% d% H`Val = $1numba process 2valu = `echo $val | tr aMuz A- Z` # determines the process type. If the write process begins with R, it pops out if [`date $val | grep ^ E`]. Then IType=EXTRACTelif [`echo $val | grep ^ P`]; then IType=POSTelif [`echo $val | grep ^ R`] Then echo "can not operate the REPLICAT process" echo "can not operate the REPLICAT process" >'$HOME'/gglog/ggnote/note-'$backuptime'.log' echo "process break off" echo "process break off" >'$HOME'/gglog/ggnote/note-'$backuptime'.log' exit 2else echo "only can operate the EXTRACT and the POST process" echo "can not operate the REPLICAT process" >'$HOME'/gglog/ggnote/note-'$backuptime'.log' echo "process break off" echo "process break off" >'$HOME'/gglog/ggnote/note-'$backuptime'.log' exit 2fiecho "-" echo "The process name is $val" echo "The process name is $val" >'$HOME'/gglog/ggnote/note- " '$backuptime'.log'echo "-" echo "-" >''$HOME'/gglog/ggnote/note-'$backuptime'.log'cd $HOME/ggserver/dirprmval= `echo $val.PRM | tr Azure Z a-z`tab = `sed-n $num'p' $val | grep ^ TABLE`sed-n $num'p' $val | grep ^ TABLE > $HOME/ggscript/ggnote/tmpcd $HOME / ggscript/ggnote/NUX= `echo ${tab} | wc-c `echo $NUXif [$NUX-le 2] Then echo "It is not the table area!" Echo "It is not the table area!" > >'$HOME'/gglog/ggnote/note-'$backuptime'.log' echo "process break off" echo "process break off" >'$HOME'/gglog/ggnote/note-'$backuptime'.log' exit 2else echo "lines have been identified: $tab" echo "lines have been identified: $tab" > >'$HOME'/gglog/ggnote/note-'$backuptime'.log 'fi# comment operation echo "-" echo "-" >' $HOME'/gglog/ggnote/note-'$backuptime'.log'echo "backup the'$val' to the'$HOME/ggserver/dirprm/bak/$val.$backuptime.bak'" echo "backup the'$val' to the'$HOME/ggserver/ Dirprm/bak/$val.$backuptime.bak' "> >'$HOME'/gglog/ggnote/note-'$backuptime'.log' cp $HOME/ggserver/dirprm/$val $HOME/ggserver/dirprm/bak/$val.$backuptime.baksed" ${num} s:TABLE:--TABLE:g "$HOME/ggserver/dirprm/$val > modtempcat modtemp > $HOME/ggserver/dirprm/$valrm-f modtempecho"-"echo"- -"> >'$HOME'/gglog/ggnote/note-'$backuptime'.log'echo" The Modify Results: "cd $HOME/ggserver/dirprmsed-n $num'p' $valecho" The Modify Results: "> >'$HOME'/gglog/ggnote/note-'$backuptime'.log'sed-n $num'p' $val > >'$HOME'/gglog/ggnote/note-'$backuptime'.log'echo" process complete "echo" process complete " > >'$HOME'/gglog/ggnote/note-'$backuptime'.log'

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

Database

Wechat

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

12
Report