系统检测
#!/bin/bash # 判断是什么系统类型 if [ -f /etc/redhat-release ]; then SYSTEM=0 else SYSTEM=1 fi function centos_info() { net_ip=`curl -s ip.sb` intranet_ip=`ifconfig | grep inet | grep -vE ...
#!/bin/bash # 判断是什么系统类型 if [ -f /etc/redhat-release ]; then SYSTEM=0 else SYSTEM=1 fi function centos_info() { net_ip=`curl -s ip.sb` intranet_ip=`ifconfig | grep inet | grep -vE ...
#!/usr/bin/env sh sql_name=$(tr -dc 'a-z' </dev/urandom | head -c 4; echo) for ((i=1;i<=3100;i++)); do four_str=$(tr -dc 'A-Z0-9' </dev/urandom | head -c 4; echo) cdkey_str=$(ech...
#!/bin/bash ss -tnl | awk '{print $4}' | grep -v Local | awk -F":" '{print $NF}' | grep -Ev "22|10022|6379" | sort | uniq > ss_port [ -f check_server_process.result ] && rm -rf check_s...
#!/bin/bash export MYSQL_PWD='***' DBRUN="mysql -A -N -h ***.***.***.*** -P 3306 -u username" sql_tables_info=" SELECT table_schema, table_name FROM information_schema.TABLES WHERE table_type = ...
1.select查询结果以指定字符串分割 select concat_ws('|', page_id, cache_time, last_cache_time) from a_page; 2.格式化时间 DATE_FORMAT(last_cache_time,'%Y%m%d%H%i%s') 3.表备份 create table e_email_0_bak_202011122005 s...
#!/bin/bash # init environment JSTACK="/opt/java/bin/jstack" JSTAT="/opt/java/bin/jstat" JMAP="/opt/java/bin/jmap" GET_TOMCAT_CRM_PID=$(ps -aux | grep tomcat-crm | egrep -v "grep" | awk '{print $...
###变量中有字符 字符串常量使用单引号括起来,如果字符串中含有变量、命令等使用双引号括起来,不建议不加引号。 特殊使用方法 $$ : Shell本身的PID(ProcessID) $! : Shell最后运行的后台Process的PID $? : 最后运行的命令的结束代码(返回值) $- : 打印当前 shell 中的当前选项集 himBH...
主函数active_user.sh #!/bin/bash # 初始化环境 ROOTDIR="/data/active_user" TMPDIR="${ROOTDIR}/tmp" LOGDIR="${ROOTDIR}/logs" mkdir -p $LOGDIR mkdir -p $TMPDIR # 初始化日志文件 LOGFILE="${LOGDIR}/active_user.log"...
国内 主程序 export_seo_task #!/bin/bash ROOTDIR="/data/rsync_seo_task" DATADIR=$ROOTDIR/data LOGSDIR=$ROOTDIR/logs TMPDIR=$ROOTDIR/tmp [ ! -d ${LOGSDIR} ] && mkdir -p $LOGSDIR [ ! -d ${LOGSDIR...
nohup不能及时打印python print日志 原因: python的输出有缓冲 标准错误stderr是直接输出,无缓冲 标准输出stdout是行缓冲,等到缓存区满了之后,再输出 解决方法 1.加参数 -u nohup python3.4 -u tcpserver.py & 2.设置环境环...