Snapshots

Contents

Snapshots

Snapshots

List of commands for manipulating repository snapshots can be seen by typing:

$ enonic snapshot

Create and restore snapshots

USAGE:
   Enonic CLI snapshot command [command options] [arguments...]

COMMANDS:
     list, ls     Returns a list of existing snapshots with name and status.
     create       Stores a snapshot of the current state of the repository.
     restore      Restores a snapshot of a previous state of the repository.
     delete, del  Deletes snapshots, either before a given timestamp or by name.

OPTIONS:
   --help, -h  show help

Create

Create a snapshot of all or a single repository while running. The snapshots will be stored in the directory given in snapshots.dir option in the Repo Configuration (default $xp_home/snapshots). Note that the first snapshot only stores markers in the repository for the current state. Subsequent snapshots stores the changes since the last snapshot. See Backup and Restore for more information on snapshots.

For a clustered installation, the snapshot-location must be on a shared file-system.
$ enonic snapshot create [-r <value>] [-a <value>]

Options:

Option Description

-a, --auth

authentication token for basic authentication (user:password).

-r, --repo

the name of the repository to snapshot.

if auth param is missing and there is no valid session CLI will look for ENONIC_CLI_REMOTE_USER and ENONIC_CLI_REMOTE_PASS environment variables. See configuration section.
Example creating new snapshot from 'cms-repo':
$ enonic snapshot create -a su:password -r cms-repo

List

List all the snapshots for the installation. See Backup and Restore for more information on snapshots.

$ enonic snapshot ls

Options:

Option Description

-a, --auth

authentication token for basic authentication (user:password).

if auth param is missing and there is no valid session CLI will look for ENONIC_CLI_REMOTE_USER and ENONIC_CLI_REMOTE_PASS environment variables. See configuration section.

Restore

Restore a named snapshot. See Backup and Restore for more information on snapshots.

$ enonic snapshot restore [--snap <value>] [--repo <value>] [--a <value>]

Options:

Option Description

--snap, --snapshot

snapshot name to restore

-r, --repo

the name of the repository to restore

-a, --auth

authentication token for basic authentication (user:password).

if auth param is missing and there is no valid session CLI will look for ENONIC_CLI_REMOTE_USER and ENONIC_CLI_REMOTE_PASS environment variables. See configuration section.

Delete

Deletes a snapshot by name or date:

$ enonic snapshot delete [-before <value>] [--snap <value>] [-a <value>]

Options:

Option Description

-b, --before

"2 Jan 06" formatted date to delete snapshots up to

--snap, --snapshot

snapshot name to delete

-a, --auth

authentication token for basic authentication (user:password).

if auth param is missing and there is no valid session CLI will look for ENONIC_CLI_REMOTE_USER and ENONIC_CLI_REMOTE_PASS environment variables. See configuration section.

Contents