mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-02-18 00:17:39 +01:00
Addresses the root cause of issue #631 (infinite Docker agent restart loop) and prevents similar issues with host-agent and sensor-proxy. Changes: - Set dockeragent.Version default to "dev" instead of hardcoded version - Add version embedding to server build in Dockerfile - Add version embedding to host-agent builds (all platforms) - Add version embedding to sensor-proxy builds (all platforms) This ensures: 1. Server's /api/agent/version endpoint returns correct v4.26.0 2. Downloaded agent binaries have matching embedded versions 3. Dev builds skip auto-update (Version="dev") 4. No version mismatch triggers infinite restart loops Related to #631
40 lines
1.0 KiB
Bash
Executable File
40 lines
1.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# Daily LOCAL backup script for CLAUDE.md
|
|
# Keeps last 30 days of backups in a LOCAL directory (never committed)
|
|
|
|
set -e
|
|
|
|
CLAUDE_MD="/opt/pulse/CLAUDE.md"
|
|
BACKUP_DIR="$HOME/.claude-md-backups" # User's home directory, not in repo
|
|
DATE=$(date +%Y-%m-%d)
|
|
BACKUP_FILE="${BACKUP_DIR}/CLAUDE.md.${DATE}"
|
|
|
|
# Create backup directory if it doesn't exist
|
|
mkdir -p "$BACKUP_DIR"
|
|
|
|
# Only create backup if CLAUDE.md exists
|
|
if [ ! -f "$CLAUDE_MD" ]; then
|
|
echo "Error: $CLAUDE_MD not found"
|
|
exit 1
|
|
fi
|
|
|
|
# Only create backup if one doesn't exist for today
|
|
if [ -f "$BACKUP_FILE" ]; then
|
|
echo "Backup already exists for today: $BACKUP_FILE"
|
|
exit 0
|
|
fi
|
|
|
|
# Create backup
|
|
cp "$CLAUDE_MD" "$BACKUP_FILE"
|
|
echo "Created backup: $BACKUP_FILE"
|
|
|
|
# Remove backups older than 30 days
|
|
find "$BACKUP_DIR" -name "CLAUDE.md.*" -type f -mtime +30 -delete
|
|
echo "Cleaned up backups older than 30 days"
|
|
|
|
# Show current backups
|
|
echo ""
|
|
echo "Current backups in $BACKUP_DIR:"
|
|
ls -lh "$BACKUP_DIR" | tail -n +2 | wc -l
|
|
echo "backups found"
|