回收 411 MB(470 M → 58.8 M),全部经回收站,可恢复: - 待清理/(146.2 M,含 relay 分片 128 M 与 42 项过程目录) - tmp/(32.4 M,按接续棒命名的过程临时区) - .workbuddy/tmp/(39.5 M) - 4 份 workbuddy.db 冗余副本(101 M,09-23 事故的坏副本 / 抢救产物) - tmp/im16/gw/centrifugo 二进制(63.9 M,可重下)+ 缓存残留 入库范围:常驻规则(CODEBUDDY.md / README.md / state.py)、在途接续入口与 接续包、docs/、交付物/、交接单/、归档/、scripts/、.codebuddy/、 .workbuddy/memory/;共 398 件,其中 >60 KB 的 26 件全为文档。 排除(.gitignore):tmp/、待清理/、运行态日志与缓存、*.db 与 DB 备份整目录、 打包二进制(*.tar.gz / *.tgz)、记忆修复前备份。
34 lines
2.2 KiB
Bash
34 lines
2.2 KiB
Bash
set +e
|
||
V=/www/server/panel/vhost/nginx
|
||
TS=$(date +%Y%m%d-%H%M%S)
|
||
DB='postgres://dshs:[email protected]:15432/dshs'
|
||
echo "=== S4-0 取实例用户名(只打印名字) ==="
|
||
psql "$DB" -t -A -c "select name from users order by name limit 6" 2>&1 | head -8
|
||
echo "--- 表清单(若上面报错则看这里) ---"
|
||
psql "$DB" -t -A -c "select tablename from pg_tables where schemaname='public' order by tablename" 2>&1 | head -14
|
||
|
||
echo "=== S4-1 备份连带项两份 ==="
|
||
cp -a "$V/relay-direct.conf" "$V/relay-direct.conf.bak-dom-$TS"
|
||
cp -a "$V/dsh.alotbuy.com.conf" "$V/dsh.alotbuy.com.conf.bak-dom-$TS"
|
||
ls -l "$V"/relay-direct.conf.bak-dom-$TS "$V"/dsh.alotbuy.com.conf.bak-dom-$TS | awk '{print $5, $9}'
|
||
|
||
echo "=== S4-2 relay-direct.conf:Host 改写 → ai1net.com ==="
|
||
sed -i 's/^\([[:space:]]*proxy_set_header Host[[:space:]]*\)alotbuy\.com;/\1ai1net.com;/' "$V/relay-direct.conf"
|
||
grep -n "proxy_set_header Host" "$V/relay-direct.conf"
|
||
|
||
echo "=== S4-3 dsh.alotbuy.com.conf:map 目标 → 新域(⛔ 不动 server_name/正则) ==="
|
||
sed -i 's/^\([[:space:]]*default[[:space:]]*\)alotbuy\.com;/\1ai1net.com;/' "$V/dsh.alotbuy.com.conf"
|
||
sed -i 's/\$label\.alotbuy\.com;/$label.ai1net.com;/' "$V/dsh.alotbuy.com.conf"
|
||
sed -n '7,10p' "$V/dsh.alotbuy.com.conf"
|
||
echo "--- 确认 server_name 未被改(应仍是 alotbuy) ---"
|
||
grep -n "server_name" "$V/dsh.alotbuy.com.conf"
|
||
|
||
echo "=== S4-4 nginx -t + reload ==="
|
||
nginx -t 2>&1 | tail -1 && nginx -s reload 2>&1 | tail -1
|
||
sleep 1
|
||
echo "=== S4-5 兜底入口验收(源站侧) ==="
|
||
curl -sk --http1.1 -o /dev/null -w "relay-direct.ai1net /dshs-overlay/bootstrap => %{http_code}\n" -H "Host: relay-direct.ai1net.com" https://127.0.0.1/dshs-overlay/bootstrap
|
||
curl -sk --http1.1 -o /dev/null -w "relay-direct.ai1net /unknown => %{http_code}(应 404)\n" -H "Host: relay-direct.ai1net.com" https://127.0.0.1/unknown
|
||
curl -sk --http1.1 -o /dev/null -w "relay-direct.alotbuy /dshs-overlay/bootstrap => %{http_code}\n" -H "Host: relay-direct.alotbuy.com" https://127.0.0.1/dshs-overlay/bootstrap
|
||
curl -sk --http1.1 -o /dev/null -w "ai1net 门户 => %{http_code}\n" -H "Host: ai1net.com" https://127.0.0.1/portal.html
|