use of org.neo4j.backup.BackupService.BackupOutcome in project neo4j by neo4j.
the class BackupTool method main.
public static void main(String[] args) {
System.err.println("WARNING: neo4j-backup is deprecated and support for it will be removed in a future\n" + "version of Neo4j; please use neo4j-admin backup instead.\n");
BackupTool tool = new BackupTool(new BackupService(), System.out);
try {
BackupOutcome backupOutcome = tool.run(args);
if (!backupOutcome.isConsistent()) {
exitFailure("WARNING: The database is inconsistent.");
}
} catch (ToolFailureException e) {
System.out.println("Backup failed.");
exitFailure(e.getMessage());
}
}
use of org.neo4j.backup.BackupService.BackupOutcome in project neo4j by neo4j.
the class BackupTool method executeBackup.
BackupOutcome executeBackup(HostnamePort hostnamePort, File to, ConsistencyCheck consistencyCheck, Config config, long timeout, boolean forensics) throws ToolFailureException {
try {
systemOut.println("Performing backup from '" + hostnamePort + "'");
String host = hostnamePort.getHost();
int port = hostnamePort.getPort();
BackupOutcome outcome = backupService.doIncrementalBackupOrFallbackToFull(host, port, to, consistencyCheck, config, timeout, forensics);
systemOut.println("Done");
return outcome;
} catch (UnexpectedStoreVersionException e) {
throw new ToolFailureException(e.getMessage(), e);
} catch (MismatchingStoreIdException e) {
throw new ToolFailureException(String.format(MISMATCHED_STORE_ID, e.getExpected(), e.getEncountered()));
} catch (ComException e) {
throw new ToolFailureException("Couldn't connect to '" + hostnamePort + "'", e);
} catch (IncrementalBackupNotPossibleException e) {
throw new ToolFailureException(e.getMessage(), e);
}
}
Aggregations