Update start-openclaw.sh
Browse files- start-openclaw.sh +8 -4
start-openclaw.sh
CHANGED
|
@@ -7,6 +7,7 @@ mkdir -p /root/.openclaw/agents/main/sessions
|
|
| 7 |
mkdir -p /root/.openclaw/agents/main/agent
|
| 8 |
mkdir -p /root/.openclaw/credentials
|
| 9 |
mkdir -p /root/.openclaw/sessions
|
|
|
|
| 10 |
|
| 11 |
# 2. 执行恢复
|
| 12 |
python3 /app/sync.py restore
|
|
@@ -14,7 +15,10 @@ python3 /app/sync.py restore
|
|
| 14 |
# 3. 强制删除旧配置
|
| 15 |
rm -f /root/.openclaw/openclaw.json
|
| 16 |
|
| 17 |
-
# 4.
|
|
|
|
|
|
|
|
|
|
| 18 |
cat > /root/.openclaw/openclaw.json << ENDOFFILE
|
| 19 |
{
|
| 20 |
"models": {
|
|
@@ -65,7 +69,7 @@ cat > /root/.openclaw/openclaw.json << ENDOFFILE
|
|
| 65 |
}
|
| 66 |
ENDOFFILE
|
| 67 |
|
| 68 |
-
#
|
| 69 |
cat > /root/.openclaw/agents/main/agent/auth-profiles.json << ENDOFFILE2
|
| 70 |
{
|
| 71 |
"profiles": {
|
|
@@ -81,9 +85,9 @@ cat > /root/.openclaw/agents/main/agent/auth-profiles.json << ENDOFFILE2
|
|
| 81 |
}
|
| 82 |
ENDOFFILE2
|
| 83 |
|
| 84 |
-
#
|
| 85 |
(while true; do sleep 3600; python3 /app/sync.py backup; done) &
|
| 86 |
|
| 87 |
-
#
|
| 88 |
openclaw doctor --fix
|
| 89 |
exec openclaw gateway run --port ${PORT}
|
|
|
|
| 7 |
mkdir -p /root/.openclaw/agents/main/agent
|
| 8 |
mkdir -p /root/.openclaw/credentials
|
| 9 |
mkdir -p /root/.openclaw/sessions
|
| 10 |
+
mkdir -p /root/.openclaw/workspace
|
| 11 |
|
| 12 |
# 2. 执行恢复
|
| 13 |
python3 /app/sync.py restore
|
|
|
|
| 15 |
# 3. 强制删除旧配置
|
| 16 |
rm -f /root/.openclaw/openclaw.json
|
| 17 |
|
| 18 |
+
# 4. 创建心跳文件,避免心跳机制反复触发
|
| 19 |
+
echo "HEARTBEAT_OK" > /root/.openclaw/workspace/HEARTBEAT.md
|
| 20 |
+
|
| 21 |
+
# 5. 生成配置文件
|
| 22 |
cat > /root/.openclaw/openclaw.json << ENDOFFILE
|
| 23 |
{
|
| 24 |
"models": {
|
|
|
|
| 69 |
}
|
| 70 |
ENDOFFILE
|
| 71 |
|
| 72 |
+
# 6. 生成 auth-profiles.json
|
| 73 |
cat > /root/.openclaw/agents/main/agent/auth-profiles.json << ENDOFFILE2
|
| 74 |
{
|
| 75 |
"profiles": {
|
|
|
|
| 85 |
}
|
| 86 |
ENDOFFILE2
|
| 87 |
|
| 88 |
+
# 7. 启动定时备份 (每 1 小时)
|
| 89 |
(while true; do sleep 3600; python3 /app/sync.py backup; done) &
|
| 90 |
|
| 91 |
+
# 8. 运行
|
| 92 |
openclaw doctor --fix
|
| 93 |
exec openclaw gateway run --port ${PORT}
|