WJiangzhi's Automated Backup

Using the BaruSikoZako backup framework to automate DSL script backups

WJiangzhi's Automated Backup (ZakoBak Automation DSL)

A scheduling extension for BaruSikoZako that uses .bsza scripts to automate backup actions.

About

ZakoBak Automation DSL (ZakoBakADSL) is an automation extension for BaruSikoZako. Write .bsza scripts to schedule backup actions and notifications from time, server state, or backup events.

The extension uses the host's public integration API. Backup capture, repositories, and authorization remain the responsibility of BaruSikoZako.

Features

  • Scheduling: Trigger actions using six-field Cron expressions or fixed intervals.
  • Lifecycles: Group conditions by calendar period or fixed duration, with nested Cron, interval, and event schedules.
  • Events: React to server startup, player-count edges, and backup task states.
  • Conditions and variables: Use if, elif, else, date and time patterns, mutable values, constants, and persistent values.
  • Idle time: Calculate observed empty-server duration and convert or round it.
  • Actions and notifications: Submit or cancel this extension's backup tasks and notify online players or administrators, optionally after a delay.
  • Runtime state: Reload scripts, persist trigger records and interval progress, and protect against event-trigger loops.

Compatibility

Requires BaruSikoZako and barusikozako_api 1.3.0 or later, and Java 17 or later. Use the Java version and host/API artifacts required for the target Minecraft version and loader.

Installation

  1. Install the matching BaruSikoZako and barusikozako_api for your game version and loader.
  2. Put zakobakadsl-<version>.jar in the client instance or dedicated server's mods directory.
  3. Start a world or server once, then edit .bsza scripts in config/zakobakadsl/scripts/.

If integration authorization is enabled, allow zakobakadsl and grant the required permissions in the host's config/barusikozako/api.yml.

Quick Start

main {
    // Submit a backup every six hours.
    interval(6h) -> { backupJob.commit() }

    // Notify administrators if a backup fails.
    event(backup.failed) -> { sendMessage.toAdmins("Backup failed; check the log") }
}

lifecycle(day) {
    // Submit once per period when the server is first observed empty.
    if (empty) -> { backupJob.commit() }
}

Save the script as a .bsza file under config/zakobakadsl/scripts/. Hot reload is enabled by default. Check the host's logs and task events for actual submission and completion results.

License

This project is licensed under the MIT License.


  • Note: This mod is an independently developed and maintained extension based on the BaruSikoZako API. Please do not submit issues related to this extension to the upstream project.

简体中文

简介

ZakoBak Automation DSL(ZakoBakADSL)是 BaruSikoZako 的自动化扩展。通过 .bsza 脚本,可以按时间、服务器状态或备份事件提交任务和发送消息。

扩展使用主模组的公开集成 API;备份捕获、仓库和权限仍由主模组管理。

功能

  • 定时调度: 使用六字段 Cron 或固定间隔触发动作。
  • 生命周期: 按日历周期或固定时长组织条件,并可嵌套 Cron、间隔和事件。
  • 事件触发: 响应服务器启动、玩家进出及备份任务状态变化。
  • 条件与变量: 支持 if、elif、else、日期和时间模式,以及内存变量、常量和持久变量。
  • 空服时间: 根据观察到的在线人数计算 idle,支持时长换算和四舍五入。
  • 动作与通知: 提交或取消本扩展发起的备份,向在线玩家或管理员发送消息,并可设置延迟。
  • 运行状态: 支持脚本热重载、触发记录和间隔进度持久化,以及事件触发频率保护。

兼容性

需要 BaruSikoZako 与 barusikozako_api 1.3.0 或更高版本,以及 Java 17 或更高版本。请按目标 Minecraft 版本使用所需 Java 版本和对应的主模组、API 文件。

下载与安装

  1. 安装与游戏版本及加载器匹配的 BaruSikoZako 和 barusikozako_api。
  2. 将 zakobakadsl-<版本>.jar 放入相应客户端实例或独立服务器的 mods 目录。
  3. 启动世界或服务器一次,在 config/zakobakadsl/scripts/ 中编辑 .bsza 文件。

如果启用了主模组的集成授权检查,请在 config/barusikozako/api.yml 中允许集成 zakobakadsl,并按所需功能授予权限。

快速开始

main {
    // 每六小时提交一次备份
    interval(6h) -> { backupJob.commit() }

    // 备份失败时通知管理员
    event(backup.failed) -> { sendMessage.toAdmins("备份失败,请检查日志") }
}

lifecycle(day) {
    // 每个周期最多在首次观察到空服时提交一次备份
    if (empty) -> { backupJob.commit() }
}

将脚本保存为 config/zakobakadsl/scripts/ 下的 .bsza 文件。默认启用热重载;动作是否成功以及任务最终结果以主模组日志和任务事件为准。

开源许可证

本项目采用 MIT 许可证。


  • 注:本模组为基于 BaruSikoZako API 独立开发与维护的扩展,请 不要 在上游项目提交与本扩展相关的 Issue。

WJiangzhi's Automated Backup Team

profile avatar
  • 1
    Followers
  • 5
    Projects
  • 3.8K
    Downloads

More from WJiangzhiView all