随笔分类 -  Shell

摘要:#!/bin/bash ## ## MongoDB Database Backup Script ## export PATH=/bin:/usr/bin:/usr/local/bin TODAY=`date +"%Y_%m_%d"` DB_BACKUP_PATH='' MONGO_HOST='' 阅读全文
posted @ 2022-08-09 14:43 捧花大王 阅读(123) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash # Shell script to backup MySQL database # Set these variables MyUSER="" # DB_USERNAME MyPASS="" # DB_PASSWORD MyHOST="" # DB_HOSTNAME # Ba 阅读全文
posted @ 2022-08-09 14:42 捧花大王 阅读(36) 评论(0) 推荐(0) 编辑
摘要:假如有下面这样一段文本内容: $ grep Lock_time: slow.log | head # Query_time: 1.097620 Lock_time: 0.000000 Rows_sent: 0 Rows_examined: 0 # Query_time: 0.000111 Lock_ 阅读全文
posted @ 2022-08-03 19:00 捧花大王 阅读(188) 评论(0) 推荐(0) 编辑
摘要:[root@mysql-host1 ~]# vim /usr/local/script/his.sh #!/bin/bash #history export HISTTIMEFORMAT="[%Y.%m.%d %H:%M:%S] " export HISTFILESIZE=10000000 expo 阅读全文
posted @ 2022-08-03 01:50 捧花大王 阅读(52) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash DIR="$( cd "$( dirname "$0" )" && pwd )" cd ${DIR} #配置Archery数据库的连接地址 archery_db_host="10.0.0.11" archery_db_port=3306 archery_db_user="zh 阅读全文
posted @ 2022-08-03 01:47 捧花大王 阅读(53) 评论(0) 推荐(0) 编辑
摘要:#!/bin/bash for i in `ls -larth --time-style=long-iso mysql-bin.* |grep 2021-11-19 | awk '{print $8}'`; do scp $i 10.0.0.12:/backup/mysql3306/binlog/; 阅读全文
posted @ 2022-08-03 01:45 捧花大王 阅读(14) 评论(0) 推荐(0) 编辑
摘要:-- 俄罗斯方块 [root@mysql-host1 ~]# cat eluos.sh #!/bin/bash APP_NAME="${0##*[\\/]}" APP_VERSION="1.0" #颜色定义 iSumColor=7 #颜色总数 cRed=1 #红色 cGreen=2 #绿色 cYel 阅读全文
posted @ 2022-07-26 14:36 捧花大王 阅读(62) 评论(0) 推荐(0) 编辑
摘要:day02-shell变量 1、自定义变量 [root@db01 ~]# echo $(ifconfig bond0 | grep inet) 定义变量 变量名=xxx 不能数字命名,不能-。 调用变量 $变量名 ${变量名} 查看变量 echo $变量名 取消变量 unset 变量名 变量作用范围 阅读全文
posted @ 2020-10-16 02:07 捧花大王 阅读(79) 评论(0) 推荐(0) 编辑
摘要:day01-认识shell 录像工具ScreenFlow ./ 执行需要添加执行权限 chmod +x sh/bash 不需要添加执行权限 screen命令 |tee -a 1.sql 追加 ; || && * 匹配任意多个字符 ? 匹配任意一个字符 [] 匹配括号中任意一个字符a-z,A-Z,0- 阅读全文
posted @ 2020-10-16 02:03 捧花大王 阅读(97) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示