2625cf36d2
- Complete backup script for native Nextcloud (MySQL + files) - Systemd service and timer for daily automated backups at 2 AM - Backblaze B2 integration with secure credential storage - Incremental backup support with 30-day retention - zstd compression for 40-70% storage reduction - Comprehensive documentation and deployment guides - Successfully tested with first backup: 203MB DB + 1.3GB files - Cost-optimized: ~/bin/bash.01-0.02/month for 1.5GB data Deployment Details: - Installed B2 CLI via pipx - Created backup directories at /opt/nextcloud-backup/ - Configured systemd timer for daily execution at 2 AM - First backup verified in B2 bucket: jg-nextcloud - Automated scheduling enabled and tested Documentation includes: - Deployment report with complete setup details - Quick start guide for future deployments - Comprehensive technical reference - Troubleshooting procedures - File manifest and index
71 lines
2.2 KiB
Bash
71 lines
2.2 KiB
Bash
# Nextcloud Backup Configuration (AUTO-GENERATED)
|
|
# Created for VM103 (next) at 192.168.88.62
|
|
|
|
# ============================================================================
|
|
# NEXTCLOUD CONFIGURATION
|
|
# ============================================================================
|
|
|
|
# Path to docker-compose directory (or Nextcloud installation directory)
|
|
# VM103 runs Nextcloud natively with Apache (not Docker)
|
|
NEXTCLOUD_COMPOSE_DIR=/var/www/nextcloud
|
|
|
|
# Full path to Nextcloud data directory
|
|
# Local 2TB disk at /dev/sdb1, mounted as /mnt/nextcloud-data
|
|
NEXTCLOUD_DATA_PATH=/mnt/nextcloud-data
|
|
|
|
# Database configuration
|
|
# MySQL on localhost, db 'nextcloud', user 'nextcloud'
|
|
NEXTCLOUD_DB_NAME=nextcloud
|
|
NEXTCLOUD_DB_USER=nextcloud
|
|
NEXTCLOUD_DB_PASSWORD=Jogiocsi1211+
|
|
NEXTCLOUD_CONTAINER=nextcloud
|
|
|
|
# ============================================================================
|
|
# BACKUP CONFIGURATION
|
|
# ============================================================================
|
|
|
|
# How many days to keep backups
|
|
BACKUP_RETENTION_DAYS=30
|
|
|
|
# Compression algorithm (zstd recommended)
|
|
COMPRESSION=zstd
|
|
|
|
# Directory to store local backup metadata and logs
|
|
BACKUP_DIR=/opt/nextcloud-backup/.backups
|
|
|
|
# Temporary directory for assembling backups
|
|
TEMP_DIR=/tmp/nextcloud-backup
|
|
|
|
# ============================================================================
|
|
# BACKUP STRATEGY
|
|
# ============================================================================
|
|
|
|
# Backup type for scheduled backups (incremental or full)
|
|
BACKUP_TYPE=incremental
|
|
|
|
# Perform test/dry-run (no actual upload)
|
|
DRY_RUN=false
|
|
|
|
# ============================================================================
|
|
# LOGGING & MONITORING
|
|
# ============================================================================
|
|
|
|
# Log level: DEBUG, INFO, WARN, ERROR
|
|
LOG_LEVEL=INFO
|
|
|
|
# Path to log files
|
|
LOG_DIR=${BACKUP_DIR}/logs
|
|
|
|
# Send alerts on failure (requires mail system configured)
|
|
ALERT_EMAIL=jgitta@jgitta.com
|
|
|
|
# ============================================================================
|
|
# SCHEDULING (only used by systemd timer)
|
|
# ============================================================================
|
|
|
|
# Time for daily backup (24-hour format)
|
|
BACKUP_TIME=02:00:00
|
|
|
|
# Optional: Weekly full backup schedule
|
|
FULL_BACKUP_DAY=Sunday
|