PotatoSack
慢慢来,老朋友,这袋土豆可比苏珊阿姨的大理石雕像好拿多了!
语言:简体中文 | English
这是什么?
这是一个简单的备份插件,最初是为我的 Minecraft 服务器编写的,用于备份指定目录中的数据。它支持增量/全量备份机制,且增量备份支持区块级粒度。
备份后的归档文件不会存储在本地,而是上传到 OneDrive、Dropbox 和 S3 / S3 兼容对象存储等云存储服务。
目前,该插件支持 OneDrive(非世纪互联版)、Dropbox,以及 AWS S3 / S3 兼容服务(MinIO、Cloudflare R2、Wasabi、腾讯云 COS 等)。
概念
展开 / 收起:关于“一组备份”、“流式压缩上传”和“区块级增量备份”
一组备份
“一组备份”指的是“一次全量备份 + 随后的增量备份(在下一次全量备份之前)”。
每次创建新的全量备份时,都会创建一个新的“一组备份”。在下一次全量备份之前的后续增量备份都将存储在此组中。
更多详情,请参阅 备份目录结构(仅中文)。
流式压缩上传
本插件的“流式压缩上传”是指一种在压缩文件的同时将其上传至云端的备份方法,采用了以时间换空间的理念,仅占用少量内存空间(用作缓冲区),几乎不占用任何额外的磁盘空间。
之所以需要以时间换空间,是因为 OneDrive API 要求在上传大文件之前必须知道确切的最终文件大小,因此需要一个额外的进程来模拟压缩以计算文件大小。
如果您使用的是 Dropbox,则无需以时间换空间,因为 Dropbox 不需要预先知道文件的总大小(但是,如果您的服务器部署在中国大陆,您可能需要设置代理以确保能够访问 Dropbox API (;´д`)ゞ)。
S3 也不需要预先知道最终的对象大小(分片上传只需要部分大小),因此使用 S3 时,流式模式也无需额外的尺寸计算流程。
传统的备份方法是先将要备份的文件临时压缩为 zip 归档文件,然后再上传到云端,这需要足够的磁盘空间来容纳待备份的文件和生成的 zip 归档文件。
然而,许多 Minecraft 服务器托管提供商限制了可用磁盘空间。如果可用空间仅为 10 GiB,而世界数据占用了 7 GiB,那么磁盘上剩余的空间将无法容纳临时的 zip 归档文件,导致备份失败。
区块级增量备份
从 3.0.0 版本开始,PotatoSack 实现了成本和维护复杂度相对较低的区块级增量备份。PotatoSack 在备份记录文件中存储区域时间戳表,并通过检查区块时间戳是否已更改来确定是否需要增量备份。增量备份归档文件也以专门的 PSMCA(delta mca)格式存储每个 .mca 文件,其中仅包含已更改的区块。
注意:为了保持维护的可控性,我们没有实现更细粒度的变更检测,例如在移除 InhabitedTime 和 LastUpdate 等易变字段后对区块进行哈希处理,甚至细化到区块级别。这些方法需要解压区块数据并解析 NBT,这将增加计算复杂度,同时显著增加维护难度(Mojang 可能会从一个版本到下一个版本更改这些底层数据字段)。更细粒度的哈希字节串也难以压缩,如果记录文件为每个区块存储如此细粒度的状态,随着 .mca 文件的生成,其体积将会显著增长。
在测试中,在有利条件下,3.0.0 的增量备份归档文件已经比 2.x.x 版本小 85%(具体减少量取决于玩家移动的区域)。切换到紧凑的二进制格式并对其进行压缩后,记录文件的体积也显著减小。这对于当前用途来说已经足够。
使用时戳作为主要缺点在于,只要玩家在附近,区块就可能被更改(对于区域文件,这主要通过 InhabitedTime 体现),这会更新区块及其时间戳。与 2.x.x 机制(任何更改都会备份整个 .mca 区域文件)相比,3.0.0 仍然从增量备份归档文件中移除了大量冗余数据。
安装
- 从此处下载插件。(
PotatoSack*.jar)
- 将插件放入服务器目录下的
plugins 文件夹中。
- 启动服务器,插件将生成初始配置文件
configs.yml。你需要对其进行配置。
- 配置完成后重启服务器。如果你看到如下日志,说明插件已成功初始化。
[12:52:32 INFO]: [PotatoSack] PotatoSack successfully initialized! Savor using it!
配置
配置文件位于 plugins/PotatoSack/configs.yml。
# PotatoSack 配置版本
version: '3.0.0'
client:
# 选择你想要使用的云存储服务提供商。
# 支持的值:onedrive / dropbox / s3
use: onedrive
# 在云存储中存储备份的基础目录路径(默认为空,表示根目录)
# 示例:如果设置为 "my/backups",数据将存储在 "my/backups/PotatoSack/..."
# 注意:前导和尾随斜杠将被自动移除。例如,"/my/backups/" 将被视为 "my/backups"。
base-dir: ""
# OneDrive API 配置(支持 OneDrive Business(ODB) / Personal(ODC))
# 参考:https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http#5-use-the-refresh-token-to-get-a-new-access-token
# 工具:https://potatosack.imbottle.com/onedrive-token-helper.html
onedrive:
# use-app-folder 指定是否使用“应用文件夹”来存储备份。
# 参考:
# [1] https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/special-folders-appfolder
# [2] https://learn.microsoft.com/en-us/graph/onedrive-sharepoint-appfolder
# 尽管目前只有 OneDrive Personal(ODC) 完全支持“应用文件夹”(权限为 "Files.ReadWrite.AppFolder"),
# 但仍建议启用此选项以实现更安全的数据隔离和未来的兼容性。
# 对于 OneDrive Business(ODB),数据隔离可能无法完全支持,
# 但应用文件夹仍可正常创建和使用(权限为 Files.ReadWrite.All)。
use-app-folder: true
client-id:
client-secret:
refresh-token:
# Dropbox API 配置
# 创建一个 Dropbox 应用,并使用具有 "files.content.write"、
# "files.content.read" 和 "files.metadata.read" 权限的刷新令牌。
# 工具:https://potatosack.imbottle.com/dropbox-token-helper.html
dropbox:
app-key:
app-secret:
refresh-token:
# S3 / S3 兼容对象存储配置(AWS S3、QCloud COS、Aliyun OSS、...)
# 注意:仅支持静态凭证(访问密钥/秘密密钥,可选会话令牌)。
# 注意:目标桶所需的 IAM 权限:
# s3:ListBucket, s3:GetObject, s3:PutObject, s3:AbortMultipartUpload, s3:DeleteObject
# 注意:S3 上传使用固定的 32 MiB 分片(最多 10,000 个分片),因此一个备份对象限制约为
# 312.5 GiB。不建议归档接近数百 GiB 的文件。
s3:
# 自定义端点。留空以使用 SDK 根据 “region” 选择的 AWS S3 端点。
# 对于 MinIO 或其他 S3 兼容服务,请填写包含方案的完整端点,例如
# endpoint: "http://127.0.0.1:9000"
# endpoint: "https://minio.example.com"
endpoint: ""
# 用于签名的区域。它必须与服务器的签名配置匹配。
# AWS S3 用户应将其设置为桶的实际区域;大多数 S3 兼容服务接受默认值 "us-east-1"(MinIO 的默认区域也是 us-east-1)。
region: "us-east-1"
# 对象存储桶的名称。
# 插件在此桶内 "<base-dir>/PotatoSack/..." 下存储数据。
bucket: ""
# 访问密钥 (Access Key)
access-key: ""
# 秘密密钥 (Secret Key)
secret-key: ""
# 会话令牌,仅在临时凭证时需要。留空则仅使用 AK/SK。
session-token: ""
# 是否使用路径样式访问 (http://endpoint/bucket/key) 而不是
# 虚拟主机样式访问 (http://bucket.endpoint/key)。
# MinIO 和大多数自定义端点需要设置为 true;AWS S3 本身通常保持 false。
path-style-access: false
# 保留的全量备份数量,实际上指的是要保留的“备份组”数量。
# 注意:“一组备份”由一个全量备份及其后的一组增量备份组成(直到下一个全量备份之前)。
# 注意:如果删除了一个全量备份,其后的所有增量备份(直到下一个全量备份之前)也将被删除。
max-full-backups-retained: 10
cron:
# 生成全量备份的 Cron 表达式
# 注意:这使用标准的 UNIX Cron 语法。
# 示例:"0 2 */1 * *" 表示每天凌晨 2:00 运行全量备份。
full-backup: "0 2 */1 * *"
# 生成增量备份的 Cron 表达式
# 注意:这使用标准的 UNIX Cron 语法。
# 示例:"*/30 * * * *" 表示每 30 分钟运行一次增量备份。
incremental-backup: "*/30 * * * *"
# 当没有玩家加入时是否停止增量备份
# - true:如果自上次增量/全量备份以来没有玩家加入,则跳过增量备份
# - false:无论玩家活动如何,都按照 cron 表达式执行增量备份
stop-incremental-backup-when-no-player: true
# 当没有玩家加入时是否停止全量备份
# - true:完成全量备份后,如果没有玩家加入,则跳过后续计划的全量备份,直到有玩家再次加入
# - false:无论玩家活动如何,都按照 cron 表达式执行全量备份
stop-full-backup-when-no-player: false
# 是否在压缩文件的同时上传。(时间与空间的权衡)
# 注意:这将防止在创建备份期间将 zip 文件完全写入本地磁盘,而是将其分块直接上传到云端,因此当创建 zip 文件时,备份过程不受磁盘大小限制。
# 注意:实际上,这会将每个 zip 文件的块临时写入内存中的缓冲区,但这通常只需要**常量**额外空间,成本不高。(OneDrive/Dropbox 每块约 15.625 MiB,S3 为 32 MiB。)
use-streaming-compression-upload: false
# 您希望进行备份的目录路径,可以是绝对路径或相对路径(相对于服务器根目录),示例:
# paths:
# - world
# - ./world_nether
# - world_the_end
# - plugins/GroupManager
#
# Minecraft JE 26.1 之后,可以是:
# paths:
# - /workspace/server/world
#
# 注意 1:如果留空,插件将无法工作。
# 注意 2:所有路径必须位于服务器根目录下。
# 注意 3:您可以在服务器根目录中放置一个 .potatosackignore 文件,以排除某些文件或目录不被备份。
# 更多信息,请参阅 README。
# 注意 4:路径不能是服务器根目录本身。
# 注意 5:备份路径之间不能重叠。例如,不要同时包含 'world' 和 'world/playerdata'。
paths: [ ]
存储服务配置指南
有关获取配置文件所需的 key、secret 和 refresh-token 的详细指导,请参阅以下文档:
从备份中忽略特定文件
您可以在 服务器根目录 中放置一个 .potatosackignore 文件,以便在备份过程中忽略特定的文件或目录,其语法类似于 .gitignore。
为了保持实现简单,它与 .gitignore 有两个不同之处:
- 它只能放置在 服务器根目录 中。
- 不支持否定
! 语法。
示例:
# 注释:以 # 开头的行是注释;空行也会被忽略
# 末尾带有 / 的规则仅匹配目录;不带末尾斜杠的规则则同时匹配文件和目录。
# 下面两条规则适用于任何嵌套层级:
# logs/ 匹配 world/logs/、a/b/logs/ 等(仅限目录,不包括文件)
# temp 匹配 temp、plugins/temp、x/y/temp(文件或目录)
logs/
temp
# * 匹配单个路径段内的任意字符(不包括 /)。
# 在这种情况下,它匹配该路径段内的 .log 文件。
*.log
# ? 匹配单个字符(不包括 /)。
# 在这种情况下,它匹配 cache1.dat、cacheX.dat 等。
cache?.dat
# 前导 / 将规则锚定到服务器根目录。
# 在这种情况下,它仅匹配根目录下的 temp.db
/temp.db
# 包含中间斜杠的规则也会锚定到根目录。
# 在这种情况下,它仅匹配 server-root/world/region/ 下的 .mca 文件
world/region/*.mca
# ** 匹配零个或多个目录层级。
# 这将匹配 logs/ 下的所有内容
logs/**
# 位于中间的 ** 匹配零个或多个目录。
# 在这种情况下,它匹配 a/c、a/x/c、a/x/y/c 等。
a/**/c
服务器根目录是服务器 jar 文件所在的目录(例如 server.jar)。
命令
该插件只有一个命令:
/potatosack reload
用于热重载插件配置文件。
权限节点
potatosack.reload
? 管理员(Operators) 默认拥有此权限。
小工具
备份合并器
如上所述,“一组备份”由一个完整备份和一些增量备份组成。BackupsMerger 可以在我们恢复服务器数据时 将这些备份合并为一个完整的备份。
参见 BackupsMerger。
常见问题
-
问:为什么控制台在启动时会打印出 404?
答:这通常是因为插件首次初始化时云端的文件或目录缺失,但不用担心,当遇到 404 问题时,程序会自动创建所需的文件和目录。
-
问:云端中的备份数据存储在哪里?
答:取决于您使用的提供商:
-
OneDrive:取决于 configs.yml 中的 client.onedrive.use-app-folder 设置 ——
true(默认):OneDrive root/Apps/<application name>/<base-dir>/PotatoSack(应用文件夹)
false:OneDrive root/<base-dir>/PotatoSack
-
Dropbox:Dropbox root/<base-dir>/PotatoSack 或 Dropbox root/Apps/<your app name>/<base-dir>/PotatoSack。如果您在创建 Dropbox 应用时选择了“仅限应用文件夹”访问限制,则为后者(推荐)。
-
S3:<bucket>/<base-dir>/PotatoSack/...。S3 没有真正的目录——路径通过对象键前缀表示,且插件不会创建零字节标记对象。删除旧的备份组会批量删除其前缀下的所有对象。
(<base-dir> 指的是 configs.yml 中的 client.base-dir 设置)
-
问:为什么插件名为 'PotatoSack'?
答:因为我的服务器性能就像土豆一样,备份数据就像扛着一袋土豆。(゜ー゜)
如果您有其他问题,欢迎提交 Issue。
许可证
采用 Apache-2.0 许可证。
感谢您的使用。( ̄▽ ̄)"
PotatoSack
Take it easy, my old friend, this sack of potatoes is much easier to carry than Aunt Susan's marble statue!
Lang: 中文简体 | English
What's this?
This is a simple backup plugin originally written for my Minecraft server to back up data in specified directories. It supports incremental/full backup mechanism, and incremental backup supports chunk-level granularity.
Backed-up archives are not stored locally, but are uploaded to cloud storage services like OneDrive, Dropbox and S3 / S3-compatible object storage.
-
Supported Minecraft Versions: 1.19+
-
✨ This plugin can compress and upload files with little local disk space usage, thus is suitable for scenarios where the service provider has imposed a limit on disk space. See the Concepts for more details.
Currently, the plugin supports OneDrive (non-21Vianet version), Dropbox, and AWS S3 / S3-compatible services (MinIO, Cloudflare R2, Wasabi, QCloud COS, etc.).
Concepts
Expand / Collapse: About "A Group of Backups", "Streaming Compression Upload", and "Chunk-level Incremental Backup"
A Group of Backups
"A Group of Backups" refers to "one full backup + subsequent incremental backups (before the next full backup)".
Every time a new full backup is created, a new "group of backups" is created. Subsequent incremental backups before the next full backup will be stored in this group.
For more details, see Backup Directory Structure (Chinese only).
Streaming Compression Upload
The "Streaming Compression Upload" of this plugin refers to the backup method of compressing files and uploading them to the cloud at the same time, which adopts the idea of exchanging time for space, and only takes up a small amount of memory space (used as a buffer), and hardly takes up any extra disk space.
Time for space is due to the fact that the OneDrive API requires the exact final file size to be known before a large file can be uploaded, so an extra process to simulate compression is needed to calculate the file size.
If you are using Dropbox, trading time for space is not needed, because Dropbox does not require the total file size to be known in advance (however, if your server is deployed in Mainland China, you may need to set up a proxy to ensure access to the Dropbox API (;´д`)ゞ).
S3 also does not require the final object size in advance (multipart upload only needs the part size), so with S3 the streaming mode needs no extra size-calculation process either.
The traditional backup method temporarily compresses the files to be backed up into zip archives before uploading them to the cloud, which requires disk space enough to accommodate the files to be backed up and the resulting zip archives.
However, many Minecraft server hosting providers limit the available space of disk. If the available space is only 10 GiB and the world data takes up 7 GiB, the remaining space on the disk won't be able to accommodate the temporary zip archive and the backup will fail.
Chunk-level Incremental Backup
Starting with version 3.0.0, PotatoSack implements chunk-level incremental backups with relatively low cost and maintenance complexity. PotatoSack stores a region timestamp table in the backup record files and determines whether an incremental backup is needed by checking whether chunk timestamps have changed. Incremental backup archives also store each .mca file in a specialized PSMCA (delta mca) format, containing only the chunks that have changed.
Note: To keep maintenance manageable, we did not implement finer-grained change detection, such as hashing chunks after removing volatile fields like InhabitedTime and LastUpdate, or even splitting them down to the block level. These approaches require decompressing chunk data and parsing NBT, which would increase computational complexity while significantly increasing maintenance difficulty (Mojang may change these underlying data fields from one version to the next). Finer-grained hash byte strings are also difficult to compress, if the record files stored such fine-grained state for every chunk, their size would grow significantly as more .mca files were generated.
In testing, under favorable conditions, 3.0.0 incremental backup archives were already 85% smaller than those in 2.x.x (the exact reduction depends on the area in which players move). The record files also became significantly smaller after switching to a compact binary format and compressing them. This is sufficient for current use.
The main drawback of using timestamps as the criterion is that a chunk may be changed whenever a player is near it (for region files, this is mainly reflected by InhabitedTime), which updates the chunk and its timestamp. Compared with the 2.x.x mechanism, which backed up an entire .mca region file whenever anything changed, 3.0.0 still removes a substantial amount of redundant data from incremental backup archives.
Installation
- Download the plugin here. (
PotatoSack*.jar)
- Put the plugin in the
plugins directory of your server directory.
- Launch the server, and the plugin will generate the initial configuration file
configs.yml. You need to configure it.
- Restart server after you have configured the plugin. If you find the log below, it means the plugin has been successfully initialized.
[12:52:32 INFO]: [PotatoSack] PotatoSack successfully initialized! Savor using it!
Configuration
The configuration file is located at plugins/PotatoSack/configs.yml.
# PotatoSack configuration version
version: '3.0.0'
client:
# Choose the Cloud Storage Service Provider you want to use.
# Supported values: onedrive / dropbox / s3
use: onedrive
# Base directory path for storing backups in cloud storage (default: empty, meaning root directory)
# Example: if set to "my/backups", data will be stored at "my/backups/PotatoSack/..."
# Note: Leading and trailing slashes will be automatically removed. E.g., "/my/backups/" will be treated as "my/backups".
base-dir: ""
# OneDrive API Configuration (Support OneDrive Business(ODB) / Personal(ODC))
# Reference: https://learn.microsoft.com/en-us/graph/auth-v2-user?tabs=http#5-use-the-refresh-token-to-get-a-new-access-token
# Tool: https://potatosack.imbottle.com/onedrive-token-helper.html
onedrive:
# use-app-folder specifies whether to use the "app folder" for storing backups.
# Reference:
# [1] https://learn.microsoft.com/en-us/onedrive/developer/rest-api/concepts/special-folders-appfolder
# [2] https://learn.microsoft.com/en-us/graph/onedrive-sharepoint-appfolder
# Although currently only OneDrive Personal(ODC) fully supports the "app folder" (with permission "Files.ReadWrite.AppFolder"),
# it's still recommended to enable this option for safer data isolation and future compatibility.
# For OneDrive Business(ODB), the data isolation may not be fully supported,
# but the app folder can still be created and used normally (with permission Files.ReadWrite.All).
use-app-folder: true
client-id:
client-secret:
refresh-token:
# Dropbox API Configuration
# Create a Dropbox app and use a refresh token with "files.content.write",
# "files.content.read", and "files.metadata.read" permissions.
# Tool: https://potatosack.imbottle.com/dropbox-token-helper.html
dropbox:
app-key:
app-secret:
refresh-token:
# S3 / S3-compatible object storage Configuration (AWS S3, QCloud COS, Aliyun OSS, ...)
# Note: Only static credentials (access key / secret key, optionally with a session token) are supported.
# Note: Required IAM permissions on the target bucket:
# s3:ListBucket, s3:GetObject, s3:PutObject, s3:AbortMultipartUpload, s3:DeleteObject
# Note: S3 uploads use fixed 32 MiB parts (up to 10,000 parts), so one backup object is limited
# to about 312.5 GiB. Archives approaching hundreds of GiB are not recommended.
s3:
# Custom endpoint. Leave it empty to use the AWS S3 endpoint selected by the SDK according to "region".
# For MinIO / other S3-compatible services, fill in the full endpoint including the scheme, e.g.
# endpoint: "http://127.0.0.1:9000"
# endpoint: "https://minio.example.com"
endpoint: ""
# Region used for signing. It must match the signature configuration of the server.
# AWS S3 users should set it to the real region of the bucket; most S3-compatible services
# accept the default value "us-east-1" (MinIO's default region is also us-east-1).
region: "us-east-1"
# The object storage bucket name.
# The plugin stores data under "<base-dir>/PotatoSack/..." inside this bucket.
bucket: ""
# Access Key
access-key: ""
# Secret Key
secret-key: ""
# Session token, only needed for temporary credentials. Leave it empty to only use AK / SK.
session-token: ""
# Whether to use path-style access (http://endpoint/bucket/key) instead of
# virtual-hosted-style access (http://bucket.endpoint/key).
# MinIO and most custom endpoints require true; AWS S3 itself usually keeps false.
path-style-access: false
# The number of full backups to keep, actually it refers to "groups of backups" to keep.
# Note: "A group of backups" consists of a full backup and a set of incremental backups following it (before the next full backup).
# Note: If a full backup is deleted, all incremental backups following it before the next full backup will be deleted as well.
max-full-backups-retained: 10
cron:
# Cron expression for generating full backups
# Note: This uses standard UNIX Cron syntax.
# Example: "0 2 */1 * *" means the full backup runs every day at 2:00 AM.
full-backup: "0 2 */1 * *"
# Cron expression for generating incremental backups
# Note: This uses standard UNIX Cron syntax.
# Example: "*/30 * * * *" means the incremental backup runs every 30 minutes.
incremental-backup: "*/30 * * * *"
# Whether to stop incremental backup when no player has joined
# - true: Skip incremental backups if no player has joined since the last incremental / full backup
# - false: Perform incremental backups according to the cron expression, regardless of player activity
stop-incremental-backup-when-no-player: true
# Whether to stop full backup when no player has joined
# - true: After a full backup is completed, skip subsequent scheduled full backups if no player joins, until a player joins again
# - false: Perform full backups according to the cron expression, regardless of player activity
stop-full-backup-when-no-player: false
# Whether to upload files while compressing them. (Time-space trade-off)
# Note: It will prevent zip file from being fully written to your local disk during backup creation and instead directly upload it to the cloud part by part, therefore the backup process is not constrained by disk size limitations when creating the zip file.
# Note: Actually this will temporarily write each chunk of zip file to a buffer in memory, however, this typically only requires **constant** additional space, it's not costly. (About 15.625 MiB per chunk for OneDrive/Dropbox and 32 MiB for S3.)
use-streaming-compression-upload: false
# The directory paths that you would like to make backups, can be absolute or relative (relative to server root) paths, example:
# paths:
# - world
# - ./world_nether
# - world_the_end
# - plugins/GroupManager
#
# After Minecraft JE 26.1, it can be:
# paths:
# - /workspace/server/world
#
# Note 1: if you leave this blank, the plugin won't work.
# Note 2: all paths must be located under the server root directory.
# Note 3: you can place a .potatosackignore file in the server root directory to exclude certain files or directories from backups.
# for more information, please refer to README.
# Note 4: the path must not be the server root directory itself.
# Note 5: backup paths must not overlap with each other. E.g., do not include both 'world' and 'world/playerdata'.
paths: [ ]
Storage Service Configuration Guide
For detailed guidance on obtaining the required key, secret, and refresh-token for the configuration file, refer to the following documents:
Ignoring Specific Files From Backup
You can place a .potatosackignore file in the server root directory to ignore specific files or directories during backup, using a syntax similar to .gitignore.
To keep implementation simple, there are two differences from .gitignore:
- It can only be placed in the server root directory.
- Negation
! syntax is not supported.
Example:
# Comment: lines starting with # are comments; empty lines are also ignored
# A trailing / matches only directories; without a trailing slash, both files and directories are matched.
# Both rules below apply at any nesting level:
# logs/ matches world/logs/, a/b/logs/, etc. (directories only, not files)
# temp matches temp, plugins/temp, x/y/temp (files or directories)
logs/
temp
# * matches any characters within a single path segment (excluding /).
# In this case, it matches .log files within that path segment.
*.log
# ? matches a single character (excluding /).
# In this case, it matches cache1.dat, cacheX.dat, etc.
cache?.dat
# A leading / anchors the rule to the server root.
# In this case, it matches only temp.db in the root directory
/temp.db
# Rule with middle slash(es) also anchors to the root.
# In this case, it matches only .mca files under server-root/world/region/
world/region/*.mca
# ** matches zero or more directory levels.
# This matches everything under logs/
logs/**
# A ** in the middle matches zero or more directories.
# In this case, it matches a/c, a/x/c, a/x/y/c, etc.
a/**/c
The server root directory is the directory where the server jar file is located (e.g. server.jar).
Command
There's only one command for the plugin:
/potatosack reload
Used for hot reloading plugin configuration file.
Permission Node
potatosack.reload
? Operators will have this permission by default.
Small tools
Backups Merger
As mentioned above, a "group of backups" consists of a full backup and some incremental backups. BackupsMerger can merge these backups into one complete backup when we are to restore server data.
See BackupsMerger.
FAQ
-
Q: Why does the console print out 404 at startup?
A:This is often due to missing files or directories in the cloud when the plugin is first initialized, but don't worry, the program will automatically create the needed files and directories when it encounters a 404 problem.
-
Q: Where is the backup data stored in the cloud?
A: It depends on which provider you are using:
-
OneDrive: Depends on the client.onedrive.use-app-folder setting in configs.yml —
true (default): OneDrive root/Apps/<application name>/<base-dir>/PotatoSack (App Folder)
false: OneDrive root/<base-dir>/PotatoSack
-
Dropbox: Dropbox root/<base-dir>/PotatoSack or Dropbox root/Apps/<your app name>/<base-dir>/PotatoSack. If you selected App Folder access restriction when creating your Dropbox app, it will be the latter (recommended).
-
S3: <bucket>/<base-dir>/PotatoSack/.... S3 has no real directories — the path is expressed by object key prefixes, and no zero-byte marker objects are created by the plugin. Deleting an old backup group will delete every object under its prefix in batches.
(<base-dir> refers to the client.base-dir setting in configs.yml)
-
Q: Why the plugin is called 'PotatoSack'?
A:Because the performance of my server is similar to that of a potato, backing up data is like carrying a sack of potatoes. (゜ー゜)
Feel free to raise an issue if you have any other questions.
License
Apache-2.0 Licensed.
Thanks for using. ( ̄▽ ̄)"
评论 0
登录后参与评分
还没有评论,来抢沙发吧