Files
hyowons 68a8c7c764 auto: 일일 백업 2026-06-04 15:50
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 15:50:01 +09:00

30 lines
923 B
Bash
Executable File

#!/bin/sh
# git_autopush.sh — ~/.openclaw 워크스페이스 일일 자동 커밋·push (LLM 미경유)
# 트리거: launchd ai.openclaw.git-autopush (매일 02:00 KST)
# 인증: HTTPS + credential.helper=store (~/.git-credentials), GUI 키체인 불필요
export TZ=Asia/Seoul
export PATH=/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin
REPO="$HOME/.openclaw"
cd "$REPO" || { echo "$(date '+%F %T') repo 없음: $REPO"; exit 1; }
STAMP=$(date '+%F %T')
# 변경 없으면 빈 커밋 방지하고 종료
if [ -z "$(git status --porcelain)" ]; then
echo "$STAMP 변경 없음 — skip"
exit 0
fi
git add -A
git commit -m "auto: 일일 백업 $(date '+%F %H:%M')
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>" || { echo "$STAMP commit 실패"; exit 1; }
if git push origin main; then
echo "$STAMP push 완료 ($(git rev-parse --short HEAD))"
else
echo "$STAMP push 실패"
exit 1
fi