?️ Ancient-Backup
专为 Minecraft 服务器打造的最先进备份解决方案
✨ 功能特性
? 高性能压缩
- ZSTD 压缩:比传统 ZIP 快 3-5 倍,且拥有更优的压缩率
- 可调节级别:在速度与文件大小之间取得平衡(0-9)
- 流式模式:边压缩边上传,本地磁盘零占用
? 多种上传目标
- SFTP - 基于 SSH 加密的安全 FTP(推荐)
- FTPS - 基于 TLS/SSL 的 FTP
- OneDrive/SharePoint - Microsoft Graph API 集成
- Google Drive - 直接云端上传支持
? 智能上传管理
- 并行上传:同时向多个目标上传
- 断点续传:自动恢复中断的上传(SFTP/FTPS)
- 自适应限速:如果服务器 TPS 下降,则降低备份速度以防止卡顿
- 上传重试:使用手动命令
/abackup uploadlast 重试失败的上传
? 实时进度追踪
- 控制台实时输出:每 5 秒查看压缩和上传进度
- Discord Webhooks:带有进度条和统计信息的精美嵌入消息
- 速度监控:实时监控上传和压缩的 MB/s 速率
? 高级功能
- 文件排除:使用通配符模式跳过大型文件夹,如 dynmap 瓦片或 BlueMap 渲染文件
- 自动保留策略:远程服务器上仅保留最近 N 个备份
- 灵活调度:每隔 X 分钟运行一次备份,或在每天特定时间运行
- 世界存档安全:备份期间自动禁用自动保存,防止损坏
- 内存管理:备份完成后自动清理 RAM
- 员工通知:向拥有权限的玩家发送游戏内通知
? 安全性与可靠性
- 严格主机密钥检查:验证 SFTP 服务器指纹以防止中间人攻击
- SSH 密钥认证:使用私钥而非密码进行登录
- TLS/SSL 支持:为 FTPS 提供加密连接
- 可取消备份:使用
/abackup cancel 随时停止正在进行的备份
? 需求
- 服务端软件:Paper/Spigot/Bukkit 1.20.6+
- Java:21 或更高版本
- 权限:
ancientbackup.admin 用于执行命令,ancientbackup.notify 用于接收通知
? 快速开始
安装
- 从 Modrinth 下载最新版本
- 将 JAR 文件放入
plugins/ 文件夹
- 重启服务器
- 配置
plugins/Ancient-Backup/config.yml
基本配置
backup:
use-zstd: true # 启用 ZSTD 压缩(推荐)
zip-level: 1 # 1 = 速度快,9 = 文件最小
schedule:
enabled: true # 启用自动备份
every-minutes: 360 # 每 6 小时备份一次
upload:
sftp:
enabled: true
host: "your-server.com"
port: 22
username: "backup-user"
password: "your-password"
remote-folder: "/backups/minecraft"
首次备份
运行以下命令进行首次备份:
/abackup start
使用以下命令检查状态:
/abackup status
? 命令
| 命令 |
权限 |
描述 |
/abackup start |
ancientbackup.admin |
开始新备份 |
/abackup cancel |
ancientbackup.admin |
取消正在运行的备份 |
/abackup status |
ancientbackup.admin |
检查备份进度 |
/abackup uploadlast |
ancientbackup.admin |
重试上传上一次备份 |
/abackup reload |
ancientbackup.admin |
重新加载配置 |
? Discord 集成
在 Discord 中获取精美的实时更新:
discord:
enabled: true
webhook-url: "https://discord.com/api/webhooks/..."
notifications:
on-backup-start: true
on-zip-complete: true
on-upload-start: true
on-upload-complete: true
on-backup-complete: true
功能:
- ? 不同阶段的彩色编码嵌入消息
- ? 可视化进度条
- ⚡ 实时速度和预计剩余时间 (ETA)
- ? 分步进度追踪(1/5, 2/5 等)
⚙️ 高级配置
文件排除
排除大型文件夹以减小备份体积:
backup:
exclude:
- "logs/*.gz"
- "logs/*.log.*"
- "plugins/dynmap/web/tiles/**"
- "plugins/BlueMap/web/**"
- "**/cache/**"
流式模式
同时压缩和上传(无本地文件):
upload:
streaming-compression: true # 需要 SFTP 或 FTPS
优势:
- ⚡ 整体备份时间更快
- ? 不占用本地磁盘空间
- ? 实时更新进度
限制:
- ⚠️ 流式模式下不支持保留策略
- ? 需要 SFTP 或 FTPS 作为目标
性能调优
针对你的服务器进行优化:
performance:
max-memory-mb: 512 # 最大内存使用量
max-buffer-kb: 8192 # 压缩缓冲区大小
gc-after-zip: true # 压缩后释放内存
cleanup-after-backup: true # 完整内存清理
tps-threshold: 18.0 # 如果 TPS 低于此值则降速
保留策略
自动删除旧备份:
retention:
enabled: true
keep-last: 7 # 仅保留最近 7 个备份
filename-prefix: "backup-" # 通过前缀筛选文件
filename-suffix: ".tar.zst" # 通过后缀筛选文件
? SSH 密钥认证
为了增强安全性,请使用 SSH 密钥代替密码:
-
生成 SSH 密钥:
ssh-keygen -t ed25519 -f ~/.ssh/minecraft_backup
-
将公钥添加到服务器:
ssh-copy-id -i ~/.ssh/minecraft_backup.pub user@your-server.com
-
配置 Ancient-Backup:
sftp:
private-key-path: "plugins/Ancient-Backup/minecraft_backup"
password: "" # 使用密钥认证时留空
? 性能
基准测试结果
在运行 Paper 1.21.10 的 10GB Minecraft 服务器上测试:
| 方法 |
耗时 |
CPU 占用 |
磁盘 I/O |
| ZSTD Level 1 |
2分 15秒 |
低 |
极少 |
| ZIP Level 1 |
6分 30秒 |
中 |
中 |
| ZIP Level 9 |
12分 45秒 |
高 |
高 |
流式模式: 与传统模式相比,可将总备份时间减少 30-40%。
? 故障排除
无进度输出?
- 确保您使用的是最新版本
- 检查上传目标是否已正确配置
- 查看控制台中是否有错误消息
上传失败?
- 使用
/abackup uploadlast 重试
- 检查网络连接和凭据
- 在 config.yml 中启用调试日志
备份期间服务器卡顿?
- 降低
performance.max-buffer-kb 以减少内存使用
- 降低
backup.zip-level 以减少 CPU 占用
- 提高
performance.tps-threshold 以更早触发节流
Discord 通知无法工作?
- 验证 Webhook URL 是否正确
- 使用 curl 或在线工具手动测试 Webhook
- 检查
discord.enabled: true 是否设置
? 支持
? 许可证
本插件基于 MIT 许可证发布。详细信息请参阅 LICENSE。
⭐ 支持本项目
如果您觉得 Ancient-Backup 有用,请考虑:
- ⭐ 在 GitHub 上给项目加星
- ? 与其他服务器管理员分享
- ? 在 Modrinth 上留下评论
- ☕ 支持开发
为 Minecraft 社区 ❤️ 制作
?️ Ancient-Backup
The most advanced backup solution for Minecraft servers
✨ Features
? High-Performance Compression
- ZSTD Compression: 3-5x faster than traditional ZIP with better compression ratios
- Adjustable Levels: Balance between speed and file size (0-9)
- Streaming Mode: Compress and upload simultaneously with zero local disk usage
? Multiple Upload Destinations
- SFTP - Secure FTP with SSH encryption (recommended)
- FTPS - FTP over TLS/SSL
- OneDrive/SharePoint - Microsoft Graph API integration
- Google Drive - Direct cloud upload support
? Smart Upload Management
- Parallel Uploads: Upload to multiple destinations simultaneously
- Resume Support: Automatically resume interrupted uploads (SFTP/FTPS)
- Adaptive Throttling: Reduces backup speed if server TPS drops to prevent lag
- Upload Retry: Manual
/abackup uploadlast command to retry failed uploads
? Real-Time Progress Tracking
- Live Console Output: See compression and upload progress every 5 seconds
- Discord Webhooks: Beautiful embeds with progress bars and statistics
- Speed Monitoring: Real-time MB/s tracking for uploads and compression
? Advanced Features
- File Exclusions: Skip large folders like dynmap tiles or BlueMap renders using glob patterns
- Automatic Retention: Keep only the last N backups on remote servers
- Flexible Scheduling: Run backups every X minutes or at specific times daily
- World Save Safety: Automatically disables auto-save during backups to prevent corruption
- Memory Management: Automatic RAM cleanup after backups complete
- Staff Notifications: In-game notifications for players with permission
? Security & Reliability
- Strict Host Key Checking: Verify SFTP server fingerprints to prevent MITM attacks
- SSH Key Authentication: Use private keys instead of passwords
- TLS/SSL Support: Encrypted connections for FTPS
- Cancellable Backups: Stop backups mid-process with
/abackup cancel
? Requirements
- Server Software: Paper/Spigot/Bukkit 1.20.6+
- Java: 21 or higher
- Permissions:
ancientbackup.admin for commands, ancientbackup.notify for notifications
? Quick Start
Installation
- Download the latest version from Modrinth
- Place the JAR file in your
plugins/ folder
- Restart your server
- Configure
plugins/Ancient-Backup/config.yml
Basic Configuration
backup:
use-zstd: true # Enable ZSTD compression (recommended)
zip-level: 1 # 1 = fast, 9 = smallest file
schedule:
enabled: true # Enable automatic backups
every-minutes: 360 # Backup every 6 hours
upload:
sftp:
enabled: true
host: "your-server.com"
port: 22
username: "backup-user"
password: "your-password"
remote-folder: "/backups/minecraft"
First Backup
Run your first backup with:
/abackup start
Check status with:
/abackup status
? Commands
| Command |
Permission |
Description |
/abackup start |
ancientbackup.admin |
Start a new backup |
/abackup cancel |
ancientbackup.admin |
Cancel the running backup |
/abackup status |
ancientbackup.admin |
Check backup progress |
/abackup uploadlast |
ancientbackup.admin |
Retry uploading the last backup |
/abackup reload |
ancientbackup.admin |
Reload configuration |
? Discord Integration
Get beautiful real-time updates in Discord:
discord:
enabled: true
webhook-url: "https://discord.com/api/webhooks/..."
notifications:
on-backup-start: true
on-zip-complete: true
on-upload-start: true
on-upload-complete: true
on-backup-complete: true
Features:
- ? Color-coded embeds for different phases
- ? Visual progress bars
- ⚡ Real-time speed and ETA
- ? Step-by-step progress tracking (1/5, 2/5, etc.)
⚙️ Advanced Configuration
File Exclusions
Exclude large folders to reduce backup size:
backup:
exclude:
- "logs/*.gz"
- "logs/*.log.*"
- "plugins/dynmap/web/tiles/**"
- "plugins/BlueMap/web/**"
- "**/cache/**"
Streaming Mode
Compress and upload simultaneously (no local file):
upload:
streaming-compression: true # Requires SFTP or FTPS
Benefits:
- ⚡ Faster overall backup time
- ? No local disk space usage
- ? Real-time progress updates
Limitations:
- ⚠️ Retention policies not supported in streaming mode
- ? Requires SFTP or FTPS destination
Performance Tuning
Optimize for your server:
performance:
max-memory-mb: 512 # Maximum RAM usage
max-buffer-kb: 8192 # Buffer size for compression
gc-after-zip: true # Free memory after compression
cleanup-after-backup: true # Full memory cleanup
tps-threshold: 18.0 # Slow down if TPS drops below this
Retention Policies
Automatically delete old backups:
retention:
enabled: true
keep-last: 7 # Keep only the last 7 backups
filename-prefix: "backup-" # Filter files by prefix
filename-suffix: ".tar.zst" # Filter files by extension
? SSH Key Authentication
For enhanced security, use SSH keys instead of passwords:
-
Generate an SSH key:
ssh-keygen -t ed25519 -f ~/.ssh/minecraft_backup
-
Add the public key to your server:
ssh-copy-id -i ~/.ssh/minecraft_backup.pub user@your-server.com
-
Configure Ancient-Backup:
sftp:
private-key-path: "plugins/Ancient-Backup/minecraft_backup"
password: "" # Leave empty when using key auth
? Performance
Benchmark Results
Tested on a 10GB Minecraft server with Paper 1.21.10:
| Method |
Time |
CPU Usage |
Disk I/O |
| ZSTD Level 1 |
2m 15s |
Low |
Minimal |
| ZIP Level 1 |
6m 30s |
Medium |
Medium |
| ZIP Level 9 |
12m 45s |
High |
High |
Streaming Mode: Reduces total backup time by 30-40% compared to traditional mode.
? Troubleshooting
No progress output?
- Ensure you're using the latest version
- Check that your upload destination is properly configured
- Look for error messages in the console
Upload fails?
- Use
/abackup uploadlast to retry
- Check network connectivity and credentials
- Enable debug logging in config.yml
Server lags during backup?
- Lower
performance.max-buffer-kb to reduce memory usage
- Reduce
backup.zip-level to use less CPU
- Set
performance.tps-threshold higher to trigger throttling sooner
Discord notifications not working?
- Verify webhook URL is correct
- Test webhook manually using curl or online tools
- Check that
discord.enabled: true
? Support
? License
This plugin is released under the MIT License. See LICENSE for details.
⭐ Support the Project
If you find Ancient-Backup useful, please consider:
- ⭐ Starring the project on GitHub
- ? Sharing it with other server owners
- ? Leaving a review on Modrinth
- ☕ Supporting development
Made with ❤️ for the Minecraft community
评论 0
登录后参与评分
还没有评论,来抢沙发吧