summaryrefslogtreecommitdiff
path: root/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
diff options
context:
space:
mode:
authorKeuin <[email protected]>2021-01-13 17:47:20 +0800
committerkeuin <[email protected]>2021-01-13 17:47:20 +0800
commite0c6a21fe9bfb01237fd145064f0af309879a9fb (patch)
tree321955f96030213c2bc8c3ec350961a81b60edee /src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
parent2bc659d8f95a97d0514491e48ed9c66828a4e308 (diff)
Incremental backup now works (tested, but not thoroughly)
Diffstat (limited to 'src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java')
-rw-r--r--src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
index 645facd..b38921d 100644
--- a/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
+++ b/src/main/java/com/keuin/kbackupfabric/operation/BackupOperation.java
@@ -9,13 +9,11 @@ import net.minecraft.server.MinecraftServer;
import net.minecraft.server.command.ServerCommandSource;
import net.minecraft.world.World;
-import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import static com.keuin.kbackupfabric.util.PrintUtil.msgInfo;
-import static com.keuin.kbackupfabric.util.backup.BackupFilesystemUtil.getBackupSaveDirectory;
public class BackupOperation extends InvokableAsyncBlockingOperation {
@@ -39,15 +37,12 @@ public class BackupOperation extends InvokableAsyncBlockingOperation {
//// Do our main backup logic
// Create backup saving directory
- File backupSaveDirectoryFile = getBackupSaveDirectory(server);
- backupSaveDirectory = backupSaveDirectoryFile.getName();
- if (!backupSaveDirectoryFile.isDirectory() && !backupSaveDirectoryFile.mkdir()) {
- msgInfo(context, String.format("Failed to create backup saving directory: %s. Failed to backup.", backupSaveDirectory));
+ if (!configuredBackupMethod.touch()) {
+ PrintUtil.msgErr(context, "Failed to create backup save directory. Cannot backup.");
return;
}
- // Make zip
-
+ // Backup
BackupFeedback result = configuredBackupMethod.backup();
if (result.isSuccess()) {
// Restore old auto-save switch stat