#!/bin/bash
# Daily workspace backup - auto-commit and push
# Runs at 11pm Lisbon (22:00 UTC in winter, 21:00 UTC in summer)

cd /home/clawd/workspace

# Check for changes
if [[ -n $(git status --porcelain) ]]; then
    git add -A
    git commit -m "Auto-backup $(date +%Y-%m-%d\ %H:%M)"
    git push origin main
    echo "$(date): Backup committed and pushed"
else
    echo "$(date): No changes to backup"
fi
