Mysql主从复制监控脚本,监控IO和SQL线程。如果问题。发送邮件报警。#!/bin/bash#writebylijun#Date2014-08-12#Descriptionmonitorthemasterpassthedatatotheslave#=====================mail="邮件地址"#===================#获取slaveio进程和sql进程的状态b="`mysql-uroot-p..
分类:
数据库 时间:
2014-08-13 03:49:15
阅读次数:
278
介绍之前先思考一个问题:有时我们通过su命令切换用户后,却发现并没有进入该用户的shell环境。这是为什么?login shell:取得bash时需要完整的登录流程。就是说通过输入账号和密码登录系统,此时取得的shell称为login shellnon-login shell:取得sbash接口的方...
分类:
其他好文 时间:
2014-08-13 00:50:54
阅读次数:
167
今天看到3.0的正式版公布了,就马上荡下来试试3.0,以下记录下环境变量配置过程打开用户文件夹下.bash_profile文件,配置环境1、首先配置下android sdk,我的是在opt文件夹下#sdkexportANDROID_SDK_ROOT=/opt/android-sdk-macosxex...
分类:
其他好文 时间:
2014-08-12 21:22:54
阅读次数:
227
#!/bin/bash
#unzip?zip&tar?file
function??untarfile(){
for?i?in?$(?ls?.?|grep?-v?.sh)
do
val=$(echo?$i?|?grep?".zip$"?|wc?-l)
if?[[?"$val"??-eq??1?]];then
dirname=$(echo?...
分类:
其他好文 时间:
2014-08-12 17:47:04
阅读次数:
237
断断续续 的写shell 老是忘记,现在把写过的传上来 ,好复习 #?/bin/bash
usage(){
echo?"usage?:?`basename?$0`?11111111111111111111111?11"
}
#echo?$#
LOGDIR=""
if?[?$#?!=?2?];then
?usa...
分类:
其他好文 时间:
2014-08-12 17:46:15
阅读次数:
203
#!/bin/bash
#description:Configrealserverloandapplynoarp
SNS_VIP=(
192.168.100.210
192.168.100.220
)
case"$1"in
start)
for((i=0;i<`echo${#SNS_VIP[*]}`;i++))
do
interface="lo:`echo${SNS_VIP[$i]}|awk-F.‘{print$4}‘`"
/sbin/ifconfig$interface${SNS_VIP[$i]}br..
分类:
其他好文 时间:
2014-08-12 17:37:45
阅读次数:
205
Shell中的函数调用的使用方法见我下面的代码示例:#!/bin/bash# value initExP="adb shell /data/local/tmp/vpxdec --yv12 --flipuv -t 2 --md5 data/local/tmp/vp9Input/subset_f...
分类:
其他好文 时间:
2014-08-12 16:52:44
阅读次数:
251
~用户家目录!!数字执行历史history多少号命令,例如!10,!!执行上一条命令#脚本中的注释$输出变量的值&后台运行*零或者多个通配符()定义函数{}枚举其中任一字符[]匹配其中任意字符?一个通配符%调用后台运行的任务到前台·反引号,优先执行""弱引用,只屏蔽空格其他特殊字符..
分类:
其他好文 时间:
2014-08-12 13:56:24
阅读次数:
194
#!/bin/bash
#
yuminstallnss-pam-ldapdpam_ldapopenldap-clients-y
sed-i"/^CACHECREDENTIALS=/d;/^USESHADOW=/d;/^USELDAPAUTH=/d;/^USELDAP=/d;/^USECRACKLIB=/d;/^USELOCAUTHORIZE=/d"/etc/sysconfig/authconfig
echo"CACHECREDENTIALS=yes
USESHADOW=yes
USELDAPAUTH=yes
..
分类:
其他好文 时间:
2014-08-12 03:40:54
阅读次数:
220
一、#!/bin/bash#自动添加用户,并使初始密码为用户账户名,且用户登录时强制其更改密码i=1while[$i-le15]doif[$i-le9]thenuseradduser0$iecho"user0$i"|passwd--stdinuser0$i&>/dev/nullchage-d0user0$ielseuseradduser$iecho"user$i"|passwd--stdinuser$i&>/de..
分类:
系统相关 时间:
2014-08-12 03:35:44
阅读次数:
242