Add full server configuration backup

This commit is contained in:
admin
2026-05-04 00:09:26 +08:00
parent 66d24c32b4
commit ea19c7d80d
11 changed files with 1893 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
#!/bin/bash
set -e
BACKUP_DIR="/data/cloud/server-backup"
DATE=$(date +%F_%H-%M-%S)
mkdir -p "$BACKUP_DIR"
tar -czf "$BACKUP_DIR/server-config-$DATE.tar.gz" \
/etc/caddy/Caddyfile \
/opt/filebrowser \
/opt/uptime-kuma \
/opt/memos \
/opt/prometheus/prometheus.yml \
/opt/grafana \
/opt/gitea \
2>/tmp/server-backup-error.log
find "$BACKUP_DIR" -name "server-config-*.tar.gz" -mtime +14 -delete
echo "Backup completed: $BACKUP_DIR/server-config-$DATE.tar.gz"