-
Notifications
You must be signed in to change notification settings - Fork 7
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
Symlinks not supported. java.nio.file.FileAlreadyExistsException
#38
Comments
Would you like to test this updated test version? Here's what I changed: Index: src/main/java/de/melanx/simplebackups/config/CommonConfig.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/src/main/java/de/melanx/simplebackups/config/CommonConfig.java b/src/main/java/de/melanx/simplebackups/config/CommonConfig.java
--- a/src/main/java/de/melanx/simplebackups/config/CommonConfig.java (revision 2489fe982aa691930e04f796411d696108c002f9)
+++ b/src/main/java/de/melanx/simplebackups/config/CommonConfig.java (date 1727109200454)
@@ -1,10 +1,13 @@
package de.melanx.simplebackups.config;
+import de.melanx.simplebackups.SimpleBackups;
import de.melanx.simplebackups.StorageSize;
import net.minecraftforge.common.ForgeConfigSpec;
import javax.annotation.Nullable;
+import java.io.FileInputStream;
import java.io.IOException;
+import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.zip.Deflater;
@@ -109,6 +112,15 @@
public static Path getOutputPath(@Nullable String levelId) {
Path base = Paths.get(outputPath.get());
+ if (Files.isSymbolicLink(base)) {
+ try {
+ base = Files.readSymbolicLink(base);
+ } catch (IOException e) {
+ SimpleBackups.LOGGER.error("Failed to read symbolic link at: {}", base);
+ throw new RuntimeException(e);
+ }
+ }
+
boolean withSubDir = levelId != null && !levelId.isEmpty() && createSubDirs.get();
try {
return withSubDir ? base.toRealPath().resolve(levelId) : base.toRealPath(); It worked on my end, and I hope that it will also fix your issue. I'm not very familiar with symlinks and using them properly. |
Wow, what a quick update! I was able to test it. I symlinked Edit: I tried some other directories and I got a lot of |
Thank you! Since you now have a workaround and it works for you, this issue now has low priority for me. I don't think that I will fix it in the near future. But thank you for offering you as a tester :) |
Minecraft version
1.20.x
Simple Backups version
1.20.1-3.1.7
(Neo)Forge version
1.20.1-47.3.7
The latest.log file
https://pastebin.com/RjrXW5wv
Issue description
I am trying to run backups on my ATM9 server. I want to save my backups onto a NAS folder, so I tried to symlink a folder inside the
/data
directory to my NAS folder. When I do that, I get ajava.nio.file.FileAlreadyExistsException
on that directory. Perhaps this isn't an actual issue and I should just reference the NAS folder directly. I've been trying to work through some file permissions to get that to work but in the meantime I thought I would try a symlink.Steps to reproduce
simplebackups-common.toml
is configured withoutPath
pointed to/path/inside/minecraft/data/folder
rcon-cli
, runsimplebackups backup start
.Other information
No response
The text was updated successfully, but these errors were encountered: