Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Write backup file in a sub directory #63

Closed
dvlmemnoch opened this issue Sep 19, 2022 · 3 comments · Fixed by #102
Closed

[Suggestion] Write backup file in a sub directory #63

dvlmemnoch opened this issue Sep 19, 2022 · 3 comments · Fixed by #102
Labels
enhancement New feature or request
Milestone

Comments

@dvlmemnoch
Copy link

Hi I ran into an issue when backing up multiple bedrock servers that have the same world name. For example,

Container A
  server_name: BedrockServer1
    level_name: Survival
Container B
  server_name: BedrockServer2
    level_name: Survival

The backup files generated can conflict if the backup happens quickly. My suggestion would be to put the backup file in a sub directory. So with the example above the backup would look like:

/opt/bedrock/backups/BedrockServer1/Survival.timestamp.mcworld
/opt/bedrock/backups/BedrockServer2/Survival.timestamp.mcworld

or prepend with the server name

/opt/bedrock/backups/BedrockServer1.Survival.timestamp.mcworld
/opt/bedrock/backups/BedrockServer2.Survival.timestamp.mcworld

Of course you would still run into the same problem if the server names were not unique. Not sure if the container name could be used instead since those are required to be unique.

Thank you for this project!

@Kaiede Kaiede added the enhancement New feature or request label Jan 10, 2024
@Kaiede
Copy link
Owner

Kaiede commented Jan 10, 2024

I know this is an old enhancement request, but I do like it. I'll add it to the schedule to see if I can find time to implement this.

The trick will be that a change of this nature can really mess with the trim logic. So I'll need to play with getting the upgrade path done and make sure it works properly.

@Kaiede Kaiede added this to the 1.3 milestone May 31, 2024
@Kaiede
Copy link
Owner

Kaiede commented May 31, 2024

Scheduling this for work during 1.3 before I move onto 1.4. This will introduce a new configuration setting that can be set globally, or on a per-container basis. By default it is false, but it can be set to true to add a prefix to the backups.

Container > Global > Default

prefixContainerNameOnBackups: true
containers:
  bedrock:
    - name: Server1
      prefixContainerNameOnBackups: true
  java:
    - name: Server2
      prefixContainerNameOnBackups: true

The result of this will be that the backups would look like this:

<ContainerName>.<WorldName>.<TimeStamp>.ext

@Kaiede
Copy link
Owner

Kaiede commented Dec 6, 2024

This has been merged and will appear in the test tag shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants