borgbutler-core/src/main/java/de/micromata/borgbutler/BorgCommands.java
@@ -36,14 +36,25 @@ BorgCommand command = new BorgCommand() .setParams("--version") .setDescription("Getting borg version."); JobResult<String> jobResult = getResult(command); BorgJob<String> job = new BorgJob<>(command); JobResult<String> jobResult = job.execute(); if (jobResult == null || jobResult.getStatus() != JobResult.Status.OK) { return null; } String version = jobResult.getResultObject(); String[] strs = StringUtils.split(version); String origVersion = jobResult.getResultObject(); String version = origVersion; String[] strs = StringUtils.split(origVersion); if (strs != null) { version = strs[strs.length - 1]; // Work arround: borg returns "borg-macosx64 1.1.8" as version string (command is included). if (!StringUtils.containsIgnoreCase(origVersion, "borg")) { version = ""; } else { version = strs[strs.length - 1]; // Work arround: borg returns "borg-macosx64 1.1.8" as version string (command is included). } } if (version.length() == 0 || !Character.isDigit(version.charAt(0))) { log.error("Version string returned by '" + job.getCommandLineAsString() + "' not as expected (not borg?): " + origVersion); return null; } log.info("Borg version: " + version); return version; borgbutler-core/src/main/java/de/micromata/borgbutler/BorgJob.java
@@ -52,7 +52,12 @@ if (command == null) { return null; } CommandLine commandLine = new CommandLine(ConfigurationHandler.getConfiguration().getBorgCommand()); String borgCommand = ConfigurationHandler.getConfiguration().getBorgCommand(); if (StringUtils.isBlank(borgCommand)) { log.error("Can't run empty borg command."); return null; } CommandLine commandLine = new CommandLine(borgCommand); commandLine.addArgument(command.getCommand()); if (command.getParams() != null) { for (String param : command.getParams()) { borgbutler-core/src/main/java/de/micromata/borgbutler/jobs/AbstractCommandLineJob.java
@@ -52,6 +52,9 @@ if (commandLine == null) { commandLine = buildCommandLine(); } if (commandLine == null) { return null; } if (commandLineAsString == null) { commandLineAsString = commandLine.getExecutable() + " " + StringUtils.join(commandLine.getArguments(), " "); } @@ -61,6 +64,9 @@ @Override public JobResult<String> execute() { getCommandLineAsString(); if (commandLine == null) { return null; } DefaultExecutor executor = new DefaultExecutor(); if (workingDirectory != null) { executor.setWorkingDirectory(workingDirectory); borgbutler-server/src/main/java/de/micromata/borgbutler/server/BorgInstallation.java
@@ -55,6 +55,8 @@ if (borgCommandChanged) { configuration.setBorgCommand(newVersion.getBorgCommand()); version(configuration); } else { newVersion.copyFrom(oldVersion); // Restore all old settings. } } else { if (borgBinaryChanged) {