sysbench scripts (8)
来源:互联网 发布:伊芙蕾雅4p真假知乎 编辑:程序博客网 时间:2024/06/06 21:03
衔接上文,以下是test文件夹下的脚本。
8、iostat.sh脚本
#! /bin/sh############################################################ Copyright (c) 2012, Heng.Wang. All rights reserved.## This program is used to get the iostat information with # the given interval time.############################################################ set -x# Get the key value of input arguments format like '--args=value'.get_key_value(){ echo "$1" | sed 's/^--[a-zA-Z_-]*=//' }# Usage will be helpful when you need to input the valid arguments.usage(){cat <<EOFUsage: $0 [-h] [configure-options] -?, --help Show this help message. --interval=<> Set the report interval time (S). --outputdir=<VALUE> Set the report output directory.Note: this script is intended for internal use by developers.EOF}# Print the default value of the arguments of the script.print_default(){cat <<EOF The default value of the variables: interval $INTERVAL outputdir $OUTPUTDIR EOF}# Parse the input arguments and get the value of the input argument.parse_options(){ while test $# -gt 0 do case "$1" in --interval=*) INTERVAL=`get_key_value "$1"`;; --outputdir=*) OUTPUTDIR=`get_key_value "$1"`;; -? | --help) usage exit 0;; *) echo "Unknown option '$1'" exit 1;; esac shift done}################################################################ Define the variablesINTERVAL=1OUTPUTDIR=/opt/output# Call the parse_options function to parse the input arguments.parse_options "$@"# If the output directory is not exist, then make directory.[[ -d $OUTPUTDIR ]] || mkdir -p $OUTPUTDIRiostat -mxt $INTERVAL >> ${OUTPUTDIR}/iostat_interval_${INTERVAL}.ios
- sysbench scripts (8)
- Sysbench scripts使用说明文档
- Sysbench scripts源码分析
- sysbench scripts (1)
- sysbench scripts (2)
- sysbench scripts (3)
- sysbench scripts (4)
- sysbench scripts (5)
- sysbench scripts (6)
- sysbench scripts (7)
- sysbench scripts (9)
- sysbench scripts (10)
- sysbench scripts (11)
- sysbench scripts (12)
- sysbench scripts (13)
- sysbench scripts (14)
- sysbench scripts (15)
- sysbench
- SQL Server 2008 变量叠加必须初始化
- 【已解决】可执行程序无法在Linux上运行,显示line 1: syntax error: word unexpected (expecting ")
- sysbench scripts (7)
- free
- 中文编码杂谈
- sysbench scripts (8)
- 使用ibatis抛出java.lang.IllegalArgumentException实则抛出:NestedSQLException异常
- sysbench scripts (9)
- ADT18 编译低版本项目遇到的问题
- SQL语句取得最大件数(MSSQL ORACLE Postgre,top rownum,limit)
- lua c在linux下的编译
- MySQL慢查询的两种分析方案 slow sql
- C#中通过回车跳转到控件的焦点
- sysbench scripts (10)