问轩博客

展开菜单

企业案例

企业案例
一、如果向磁盘写入数据提示如下错误:No space left on device,通过df -h查看磁盘空间,发现没有满,请问可能原因是什么?企业场景什么情况下会导致这个问题发生?解答:小文件多,可能是Inode数量被消耗尽了。产生原因:企业工作重临时文件对应太多/var/spool/clientmquene 大量的小文件(centos5默认安装sendmail)二、一个100M(100000K)的磁盘分区,分别写入1K的文件或写入1M的文件,分别可以写多少个?解答:1.主...

keepalived安装配置

keepalived安装配置
1.安装前准备环境:Linux 2.6.32-642.el6.x86_64 #1 SMP Tue May 10 17:27:01 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux下载wget http://www.keepalived.org/software/keepalived-1.1.20.tar.gzln -s /usr/src/kernels/2.6.32-696.16.1.el6.x86_64/ /usr/src/linux...

监测网站目录是否有篡改

监测网站目录是否有篡改
方法一:md5sum [root@shnne scripts]# cat diffpro.sh  #!/bin/sh path=/server/scripts/cuangai [ ! -d $path ] && mkdir -p $path  [ ! -f $path/diff.log...

打印下面不大于6的单词

打印下面不大于6的单词
[root@shnne ~]# cat liu.log  I am shnne welcome to my blog. [root@shnne ~]# cat liu.sh  #!/bin/sh array=($(cat liu.log)) for((i=0;i<${#array[@]};i++)) do...

监测MySQL主从同步shell脚本

监测MySQL主从同步shell脚本
1. [root@shnne ~]# cat slave_check.sh  #!/bin/sh while true do flag=0  array=($(egrep "_Running|Behind_Master" slave.log|awk '{print $NF}'))    for&nb...

continue,break,exit小例子

continue,break,exit小例子
[root@shnne ~]# vim test.sh #!/bin/sh for ((i=0; i<=5; i++)) do    if [ $i -eq 3 ]     then        #contin...

shell批量修改文件名方法

shell批量修改文件名方法
1. 创建 [root@shnne ~]# cat mk.sh  #!/bin/sh for((i=1; i<=10; i++)) do   j=`cat /dev/urandom|head -1|md5sum|cut -c 1-5`   touch shnne/${j}_shnne_$i.html don...

for小练习

for小练习
通过for循环打印5 4 3 2 1[root@shnne ~]# cat for1.sh  #!/bin/sh for i in 5 4 3 2 1 do   echo $i done   [root@shnne ~]# cat for2.sh  #!/bin/sh f...