Backup - MarkusBordihn/BOs-Easy-NPC GitHub Wiki
Easy NPC Backup System
Overview 🌟
The Easy NPC backup system is designed to ensure a minimal safety net by storing backups of actively used NPCs. The backups are created and managed in a way that ensures performance and reliability, while keeping disk usage efficient.
Note: While this system provides a safety net, it is highly recommended to regularly back up the entire world where the NPCs are located. This ensures a full snapshot of all NPCs, including those that are not currently active or loaded.
Backup Behavior 🛡️
-
Storage Path: Backups are saved in the following directory structure:
easy_npc/backup/YYYY-MM-DD/YYYY-MM-DD_UUID.backup.npc.nbt
YYYY-MM-DD
: The date when the backup was created.UUID
: The unique identifier of the NPC.
-
Backup Schedule:
- Hourly: Backups are created and re-created every hour. Existing backups for the same day are automatically overwritten.
- Daily: At least one backup is stored for every day, ensuring daily snapshots.
-
Active NPCs Only:
- Only currently active and loaded NPCs are backed up. If an NPC is not loaded into memory, no backup will be created for it.
-
Server Start/Restart:
- After a server start or restart, the first backup is performed within the first few minutes of operation.
Backup Purpose 🎯
The backup system exists to provide a fallback for extreme cases. However, it is not a substitute for a full world backup.
The recommended approach is to:
- Use the Easy NPC backup system for quick access to recent NPC states.
- Perform regular full world backups to ensure all NPCs, regardless of their active state, are preserved.
Recommendations 💡
-
Automated World Backups:
- Set up an automated system to back up the entire world directory periodically. 🕒 This captures all NPCs, including those that are inactive or not loaded.
-
Storage Maintenance:
- Monitor the
easy_npc/backup
directory to ensure sufficient storage space. 📁 - Old backups can be removed if storage becomes a concern, as only recent hourly and daily backups are retained by default.
- Monitor the
-
Disaster Recovery:
- In case of data corruption or NPC loss, you can restore the NPC state using the backup files
in the
easy_npc/backup
directory. - Alternatively, restore the entire world from a full world backup for a complete recovery.
- In case of data corruption or NPC loss, you can restore the NPC state using the backup files
in the
Technical Notes ⚙️
- File Format: Backups are stored in
.nbt
format, compatible with standard Minecraft tools and utilities. - Backup Trigger: The system checks hourly for active NPCs and performs a backup if necessary.
- Performance Impact: The backup system is designed to minimize performance overhead by only processing active NPCs.