check new version
Some checks failed
Ansible Minecraft Server CI/CD / lint (push) Failing after 21s
Ansible Minecraft Server CI/CD / test (push) Has been skipped
Ansible Minecraft Server CI/CD / deploy (push) Has been skipped

This commit is contained in:
2025-08-27 07:59:19 +02:00
parent 7a2ccb537b
commit 9ea9ac7254
125 changed files with 2696 additions and 1511 deletions

View File

@@ -1,42 +0,0 @@
#!/bin/bash
# Monthly Minecraft Backup Script
# Generated by Ansible
set -e
# Source backup functions
source {{ minecraft_tools_dir }}/backup-functions.sh
# Configuration
BACKUP_DIR="{{ backup_monthly_dir }}"
DATE=$(date +%Y%m%d_%H%M%S)
BACKUP_NAME="monthly_backup_$DATE"
LOG_FILE="{{ minecraft_base_dir }}/logs/backup-monthly.log"
# Create log entry
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Starting monthly backup..." >> "$LOG_FILE"
# Create backup directory
mkdir -p "$BACKUP_DIR/$BACKUP_NAME"
# Stop Minecraft server for consistent backup
stop_minecraft
# Perform backup
{% for source in backup_sources %}
echo "Backing up {{ source }}..." >> "$LOG_FILE"
rsync {{ rsync_options }} "{{ source }}/" "$BACKUP_DIR/$BACKUP_NAME/$(basename {{ source }})/"
{% endfor %}
# Start Minecraft server
start_minecraft
# Clean old monthly backups (convert months to days approximately)
clean_old_backups "$BACKUP_DIR" $(({{ backup_retention_months }} * 30))
# Compress backup
cd "$BACKUP_DIR"
tar -czf "${BACKUP_NAME}.tar.gz" "$BACKUP_NAME"
rm -rf "$BACKUP_NAME"
echo "[$(date '+%Y-%m-%d %H:%M:%S')] Monthly backup completed: ${BACKUP_NAME}.tar.gz" >> "$LOG_FILE"