编写 Shell 脚本的最佳实践
转载自:https://blog.mythsman.com/post/5d2ab67ff678ba2eb3bd346f/
开头有 “蛇棒”
所谓 shebang 其实就是在很多脚本的第一行出现的以 "#!" 开头的注释,他指明了当我们没有指定解释器的时候默认的解释器,一般可能是下面这样:
#!/bin/bash
当然,解释器有很多种,除了 bash 之外,我们可以用下面的命令查看本机支...
Continue reading >>转载自:https://blog.mythsman.com/post/5d2ab67ff678ba2eb3bd346f/
所谓 shebang 其实就是在很多脚本的第一行出现的以 "#!" 开头的注释,他指明了当我们没有指定解释器的时候默认的解释器,一般可能是下面这样:
#!/bin/bash
当然,解释器有很多种,除了 bash 之外,我们可以用下面的命令查看本机支...
Continue reading >>#!/bin/bash # # nginx - this script starts and stops the nginx daemon # 脚本功能简介 # # chk...Continue reading >>
The first script that init runs is [/etc/rc.d/rc.sysinit]. This script does several initialization tasks: (This description is based on th...
Continue reading >>◎/etc/init.d/rpcbind
Continue reading >>生产实践:
用于Gitlab sidekiq队列停滞任务数清除重启
学习技巧:
Shell while、function,Python BeautifulSoup使用
脚本内容:
Gitlab CI任务停滞数达到几百时会导致发布系统任务阻塞,影响开发使用,之前出过几次问题,搞个脚本...
Continue reading >>生产实践:
用于Gitlab sidekiq进程挂掉自动重启
学习技巧:
while、if语句、检测记数function,sidekiq启动
脚本内容:
上次搞了个通宵,把公司用了大几年的gitlab从8.11一步步手动编译升级到了11.4.14,没想到踩了个大坑,这个版本的sidekiq调用re2正...
Continue reading >>