Skip to content

Instantly share code, notes, and snippets.

View sunwjblog's full-sized avatar
😝

sunwjcoder sunwjblog

😝
  • GuangZhou
View GitHub Profile
@sunwjblog
sunwjblog / ftp推送文件.sh
Created December 24, 2020 09:23
ftp推送文件到远程机
#/usr/bin/bash
#======alipay====
> /projects/daemon/common-audit/alipay/cmd.txt
ftp -in<<EOF
o 10.252.xxx.xxx
user gmccthirdpaxxx Tdy274xxx
prompt off
bin
passive
cd /data/ecop/thirdpayment/target
@sunwjblog
sunwjblog / 监控应用进程.sh
Created December 24, 2020 09:22
监控应用进程
#!/bin/bash
#
this_pid=$$
#this_pid 将自身脚本进程过滤
while [[ true ]]; do
ps -ef | grep mysql | grep -v grep | grep -v $this_pid &> /dev/null
if [[ $? -eq 0 ]]; then
echo "Myql is running well"
@sunwjblog
sunwjblog / sed处理文件.sh
Created December 24, 2020 09:21
需求描述:处理一个类似MySQL配置文件my.cnf的文本,示例如下: 便携脚本实现以下功能:输出文件有几个段,并且针对每个段可以统计配置参数总个数
#!/bin/bash
FILE_NAME=~/Destop/my.cnf
function get_all_segment
{
echo "`sed -n '/\[.*\]/p' $FILE_NAME | sed -e 's/\[//g' -e 's/\]//g'`"
}
function count_iterms_in_segment