switchnoflushd

来自「linux 系统控制硬盘旋转和停止的程序(spin down/up)」· 代码 · 共 34 行

TXT
34
字号
#!/bin/sh -e## $Id: switchNoflushd,v 1.1 2002/04/20 15:34:37 nold Exp $## Wrapper script to switch noflushd timeouts and log the result.## Contributed by Thomas Link <t.link@gmx.at>getNext () {	echo $1 | sed -e "s/\\([0-9]\\+\\).*/\\1/"}NOFLUSHD_DIR=/var/lib/noflushdkill -s SIGHUP `cat /var/run/noflushd.pid`DEFAULT_TIMEOUT=`cat ${NOFLUSHD_DIR}/timeout`STATE=`cat ${NOFLUSHD_DIR}/state`if [ -e ${NOFLUSHD_DIR}/history ]; then	HIST=`cat ${NOFLUSHD_DIR}/history`fiREST=`echo ${DEFAULT_TIMEOUT} | sed -e "s/^\\(${HIST},\\|.*\\)\\(.*\\)/\\2/"`NEW=`getNext ${REST}`if [ -z "${NEW}" ]; then	NEW=`getNext ${DEFAULT_TIMEOUT}`	echo ${NEW} > ${NOFLUSHD_DIR}/historyelse	echo ${HIST},${NEW} > ${NOFLUSHD_DIR}/historyfiecho ${NEW} > ${NOFLUSHD_DIR}/statelogger -t noflushd set timeout to ${NEW}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?