随笔分类 - Shell
摘要:# 2 SWAP 20GB SWAP # 3 /usr/sap 50GB /usr/sap # 4 Shared 1 x 512 GiB /hana/shared # 5、6 Log 2 x 300 GiB striped /hana/log # 7、8、9 Data 3 x 225 GiB str
        阅读全文
                
                    posted @ 2021-04-24 22:51  
云起时。
    
                
            
摘要:#!/bin/bash IP_LIST="`cat /root/ip.txt`" ip_dir="/root/ip_dir" [ ! -d ${ip_dir} ] && mkdir -p ${ip_dir} for ip_addr in ${IP_LIST}; do ping ${ip_addr} 
        阅读全文
                
                    posted @ 2021-04-24 20:37  
云起时。
    
                
            
摘要:#!/bin/bash source /etc/profile DATE="$(date +'%F')" HOST_IP="172.16.1.122" SOURCE_DIR="/opt" # 注意:目录最后面的左斜杠(/) # /opt : 同步时会将整个源目录也同步到备份目录之中 # /opt/ 
        阅读全文
                
                    posted @ 2021-04-24 20:32  
云起时。
    
                
            
摘要:#!/bin/bash source /etc/profile HOST_IP="172.16.1.122" DROP_IP_FILE="/tmp/drop_ip.log" [ ! -f $DROP_IP_FILE ] && touch $DROP_IP_FILE DATE="$(date +%d/
        阅读全文
                
                    posted @ 2021-04-24 20:27  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin PHP_NAME=$1 DATE=$(date +%F_%T) WWWROOT=/usr/local/nginx/html/$PHP
        阅读全文
                
                    posted @ 2021-04-24 20:26  
云起时。
    
                
            
摘要:#!/bin/bash export PAHT=/usr/local/maven/bin:/usr/local/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin DATE=$(date +%F_%T) TOMCAT
        阅读全文
                
                    posted @ 2021-04-24 20:24  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin LOG_DIR=/usr/local/nginx/logs YESTERDAY_TIME=$(date -d "yesterday"
        阅读全文
                
                    posted @ 2021-04-24 20:23  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin # Nginx 日志格式: # log_format main '$remote_addr - $remote_user [$tim
        阅读全文
                
                    posted @ 2021-04-24 20:22  
云起时。
    
                
            
摘要:#!/bin/bash source /etc/profile DATE="$(date +%F_%H-%M-%S)" DB_IP="172.16.1.122" HOST="localhost" PORT="3306" USER="root" PASS="Liuchang@2020" BACKUP_
        阅读全文
                
                    posted @ 2021-04-24 20:21  
云起时。
    
                
            
摘要:#!/bin/bash source /etc/profile DATE="$(date +%F_%H-%M-%S)" DB_IP="172.16.1.122" HOST="localhost" PORT="3306" USER="root" PASS="Liuchang@2020" BACKUP_
        阅读全文
                
                    posted @ 2021-04-24 20:18  
云起时。
    
                
            
摘要:#!/bin/bash source /etc/profile # 主从同步 # master:binlog # slave:relaylog # 写->master->binlog<-relaylog->slave DB_IP="172.16.1.122" HOST="localhost" POR
        阅读全文
                
                    posted @ 2021-04-24 20:17  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin NGINX_V=1.19.1 PHP_V=7.2.19 TMP_DIR=/tmp INSTALL_DIR=/usr/local PW
        阅读全文
                
                    posted @ 2021-04-24 20:16  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin COMMAND=$* HOST_INFO=host.info for IP in $(awk '/^[^#]/ {print $1}
        阅读全文
                
                    posted @ 2021-04-24 20:15  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin URL_LIST=$1 for URL in $URL_LIST; do FAIL_COUNT=0 for ((i=1; i<=3;
        阅读全文
                
                    posted @ 2021-04-24 20:13  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin HOST_INFO=host.info for IP in $(awk '/^[^#]/ {print $1}' $HOST_INF
        阅读全文
                
                    posted @ 2021-04-24 20:12  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin NIC=$1 echo -e "Time In Out" while true; do OLD_IN=$(awk '/'$NIC'/
        阅读全文
                
                    posted @ 2021-04-24 20:11  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin echo " PCPU " ps -eo user,pid,pcpu,pmem,args --sort=-pcpu | head -
        阅读全文
                
                    posted @ 2021-04-24 20:07  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin function cpu() { util=`vmstat | awk 'NR==3 {print (100-$15) "%"}'`
        阅读全文
                
                    posted @ 2021-04-24 20:06  
云起时。
    
                
            
摘要:#!/bin/bash export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin USER_LIST=$@ # USER_LIST=(user01 user02 user03) USER_FILE=./user.t
        阅读全文
                
                    posted @ 2021-04-24 20:04  
云起时。
    
                
            

浙公网安备 33010602011771号