2017年9月12日

linux系统查看磁盘信息

摘要: # smartctl -a /dev/sdx | head -20 注意:smart只能查看未做RAID的磁盘,做RAID的磁盘可以用RAID管理软件查看磁盘信息,参照另一篇随笔《raid管理软件MegaRAID Storage Manager(MSM)的安装和使用》。 阅读全文

posted @ 2017-09-12 20:53 seabiscuit0922 阅读(196) 评论(0) 推荐(0) 编辑

【转】软链接和硬链接

摘要: 转自:http://www.jianshu.com/p/dde6a01c4094 什么是链接? 链接简单说实际上是一种文件共享的方式,是 POSIX 中的概念,主流文件系统都支持链接文件。 它是用来干什么的? 你可以将链接简单地理解为 Windows 中常见的快捷方式(或是 OS X 中的替身),L 阅读全文

posted @ 2017-09-12 19:58 seabiscuit0922 阅读(102) 评论(0) 推荐(0) 编辑

shell:统计周期时间内磁盘的写带宽总量

摘要: 1 #!/bin/bash 2 # 作用:统计周期时间内磁盘的写带宽总量 3 4 let aDay=24*3600 #一天多少秒 5 startTime=$(date +%s) 6 nohup iostat -mxt 1 >output & 7 count=0 #记录次数 8 circle=7 #循环统计周期,这里为一周 9 sum=0 #一个周期内的写带宽总量 1... 阅读全文

posted @ 2017-09-12 17:54 seabiscuit0922 阅读(249) 评论(0) 推荐(0) 编辑

shell:统计一周时间内的日志总大小,清空达到2G的log并计数

摘要: 1 #!/bin/bash 2 #统计一周时间内的日志总大小,清空达到2G的log并计数 3 4 #dir="/home/parastor/log" #目录格式最后不加/ 5 dir="/var/log" 6 let maxsize=2*1024*1024*1024 #日志大小的最大值2G,单位B 7 let maxsizeG=2 #日志大小的最大值2G,单位GB 8 le... 阅读全文

posted @ 2017-09-12 16:26 seabiscuit0922 阅读(944) 评论(0) 推荐(0) 编辑

shell:递归遍历文件夹及其子文件夹

摘要: 1 #!/bin/bash 2 #遍历文件夹及其子文件夹内所有文件,并查看各个文件大小 3 dir="/root/test" #要遍历的目录 4 5 #子函数getdir 6 function getdir() 7 { 8 for element in `ls $1` 9 do 10 file=$1"/"$element 11 ... 阅读全文

posted @ 2017-09-12 15:37 seabiscuit0922 阅读(3786) 评论(0) 推荐(0) 编辑

配置NFS Server

摘要: 1. 环境设置 1.1 关闭防火墙 # service iptables stop # chkconfig iptables off 1.2 关闭SELinux # vim /etc/selinux/config SELINUX=disabled # /usr/sbin/sestatus -v #查 阅读全文

posted @ 2017-09-12 13:57 seabiscuit0922 阅读(242) 评论(0) 推荐(0) 编辑

导航