Denys Hryvastov
Denys Hryvastov

Reputation: 27

How to automate Neo4j online backups creation

I am trying to automate the process of creating online backups. Could you please advice what is the best way of doing this?

One of the possible solutions is to create Java process, using Spring scheduler for example. Using some time rule (cron expression) this process will invoke pretty simple Java code for creating online backups from Java:

File backupPath = new File("path to backup folder");
backupPath.mkdir();

OnlineBackup backup = OnlineBackup.from( InetAddress.getLocalHost().getHostAddress() );
backup.full( backupPath.getPath() );
backup.incremental( backupPath.getPath() );

Is there any better or recommended way of automatizing online backups creating?

Thanks in advance, Denys

Upvotes: 2

Views: 1448

Answers (1)

Stefan Armbruster
Stefan Armbruster

Reputation: 39915

Use the $NEO4J_DIR/bin/neo4j-backup script. This script is a simple wrapper around the code in your question. Put this into a cron script or trigger it from your system's backup tool.

For docs, see http://docs.neo4j.org/chunked/stable/backup-embedded-and-server.html

Upvotes: 1

Related Questions