Skip to content
lvca edited this page Dec 14, 2012 · 2 revisions

Setup automatic backup

Java class implementation:

    com.orientechnologies.orient.server.handler.OAutomaticBackup

Introduction

Configure an automatic backup of databases. This task is configured as a Server handler. The task can be configured in easy way by changing parameters:

  • enabled: true to turn on, false (default) is turned off
  • delay: delay time. You can use different suffixes to specify different measures:
  • ms for milliseconds. Example 10000ms means 10 seconds
  • s for seconds. Example 10s means 10 seconds
  • m for minutes. Example 5m means 5 minutes
  • h for hours. Example 24h means every day
  • d for days. Example 1d means every day
  • target.directory: target directory, the default is "backup"
  • target.fileName: target file name configurable using the following variables between ${}:
  • ${DBNAME}, as the database name
  • ${DATE}, as the current date following the format. For the complete syntax look at Java DateTime syntax
  • db.include: database list to include. If empty means all the databases
  • db.exclude: database list to exclude

NOTE: This feature is available since v. 1.0rc6.

Default configuration in orientdb-server-config.xml

    <!-- AUTOMATIC BACKUP, TO TURN ON SET THE 'ENABLED' PARAMETER TO 'true' -->
    <handler class="com.orientechnologies.orient.server.handler.OAutomaticBackup">
      <parameters>
        <parameter name="enabled" value="false" />
        <parameter name="delay" value="4h" />
        <parameter name="target.directory" value="backup" />
        <parameter name="target.fileName" value="${DBNAME}-${DATE:yyyyMMddHHmmss}.json" /><!-- ${DBNAME} AND ${DATE:} VARIABLES ARE SUPPORTED -->
        <parameter name="db.include" value="" /><!-- DEFAULT: NO ONE, THAT MEANS ALL DATABASES. USE COMMA TO SEPARATE MULTIPLE DATABASE NAMES -->
        <parameter name="db.exclude" value="" /><!-- USE COMMA TO SEPARATE MULTIPLE DATABASE NAMES -->
      </parameters>
    </handler>
Clone this wiki locally