ai_member_xiaoban/scripts/backup_workspace.sh

21 lines
544 B
Bash
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
set -e
# 进入workspace目录
cd /root/.openclaw/workspace-xiaoban
# 配置git信息
git config user.name "xiaoban"
git config user.email "xiaoban@valavala.com"
# 添加所有文件,自动排除.gitignore里的内容包括secrets.md
git add .
# 提交变更
COMMIT_MSG="自动备份 $(date +'%Y-%m-%d %H:%M:%S')"
git commit -m "$COMMIT_MSG" || echo "无变更需要提交"
# 推送到远程仓库
git push https://git.valavala.com/ai_member_only/ai_member_xiaoban master
echo "✅ Workspace备份完成$COMMIT_MSG"