Embed backup scripts in Docker image

This commit is contained in:
2026-06-22 18:25:38 +00:00
parent 27dcbf9c24
commit 66627691d7
6 changed files with 190 additions and 6 deletions
+31
View File
@@ -0,0 +1,31 @@
#!/bin/bash
# Backup /root/Apps → Google Drive (Apps)
set -e
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_DIR="/tmp/backup-apps"
DEST="gdrive:Apps"
echo "[$(date)] Backup Apps started"
# Cleanup old temp
rm -rf "$BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
# Backup important apps configs
tar -czf "$BACKUP_DIR/apps-configs-$DATE.tar.gz" \
/root/Apps/Camila \
/root/Apps/RAG \
/root/Apps/VOXDO \
2>/dev/null || true
# Sync to Google Drive
rclone copy "$BACKUP_DIR" "$DEST" --progress
# Keep only last 7 days in GDrive
rclone delete "$DEST" --min-age 7d
# Cleanup local
rm -rf "$BACKUP_DIR"
echo "[$(date)] Backup Apps finished"