feature(cli): 增加日志集中和强制停止脚本

This commit is contained in:
2023-06-13 12:11:56 +08:00
parent 04a23431f7
commit 20b3d17ab3
3 changed files with 84 additions and 10 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/bash
hosts=(
<#list hosts as host>
${host}
</#list>
)
for host in <#noparse>${hosts[@]}</#noparse>
do
hostname=`ssh $host 'echo $HOSTNAME'`
echo "$host $hostname"
ssh $host 'bash -s' < force-stop.sh ${runtime.jarPath}/${info.name}.jar
done

View File

@@ -0,0 +1,17 @@
#!/bin/bash
hosts=(
<#list selectedHosts as host>
${host}
</#list>
)
mkdir -p logs/${info.name}
rm -rf logs/${info.name}/*
for host in <#noparse>${hosts[@]}</#noparse>
do
hostname=`ssh $host 'echo $HOSTNAME'`
echo "$host $hostname"
ssh $host "cat ${runtime.logPath}/${info.name}.log" > logs/${info.name}/$hostname.log
done