07 2023 档案
摘要:脚本功能:停止原有容器,按照用户传入的参数启动新的容器 使用系统自带的方法需要安装依赖 yum install redhat-lsb vi docker-deploy.sh #!/bin/bash lsb_functions="/lib/lsb/init-functions" if test -f
阅读全文
摘要:一、基础配置 user root; worker_processes 1; events { worker_connections 10240; } http { log_format '$remote_addr - $remote_user [$time_local] ' '"$request"
阅读全文
摘要:一、配置多个location匹配规则 location ^~ /admin { alias /var/www/admin/; index regist.html; } location / { root /data/html/; index index.html index.html; } 二、ro
阅读全文
摘要:#!/bin/bash # 输入文件路径 input_file="input.txt" # 输出文件路径 output_file="output.txt" # 使用awk将以分号为分割符的第3列空值替换为999并输出到新文件 awk 'BEGIN { FS = OFS = ";" } {$3 = (
阅读全文
摘要:#!/bin/bash # 获取虚拟机启动时间戳 boot_timestamp=$(date -d "$(uptime -s)" +%s) # 当前时间戳 current_timestamp=$(date +%s) # 计算运行时长(以秒为单位) runtime=$((current_timesta
阅读全文