$0:Shell本身的文件名
$1 : shell中的第一个参数
$n: : shell中的第n个参数
$@ 是传给脚本的所有参数的列表
$#: 所有的参数列表
$(dirname $0): 当前目录
mkdir -p:允许一次性创建多层次的目录
if [[ ${pid} -gt 0 ]] # if条件成立,则执行then语句
then
echo `date`
fi
supervise: 守护进程
./supervise -f 要守护的程序 -p 守护信息存储位置
taskset:taskset的简单用法--进程绑核
taskset -c 3 command 表示执行command命令,并将command启动的进程绑定到第3个核上。
case的用法:
case $1 in
start)
xxxxx
;;
stop)
xxxxx
;;
esac # case语句块的结束
路径的shell命令:
now_DIR = './'
log_path = os.path.join(now, 'log') #
if not os.path.isdir(log_path):
os.mkdir(log_path)
网友评论