Common Commands

Common Commands

  • diff - Displays differences between two repository objects (files or directories)
  • list - List a directory stored in repository object.
  • restore - Restore a directory or a file.

Restore can operate in two modes:

  • from a snapshot: restoring (possibly shallowly) a specified file or directory from a snapshot into a target path. By default, the target path will be created by the restore command if it does not exist.

  • by expanding a shallow placeholder in situ where the placeholder was created by a previous restore.

In the from-snapshot mode:

The source to be restored is specified in the form of a directory or file ID and optionally a sub-directory path.

For example, the following source and target arguments will restore the contents of the ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ directory into a new, local directory named ‘d1’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9 d1’

Similarly, the following command will restore the contents of a subdirectory ‘subdir/subdir2’ under ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ into a new, local directory named ‘sd2’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9/subdir1/subdir2 sd2’

When restoring to a target path that already has existing data, by default the restore will attempt to overwrite, unless one or more of the following flags has been set (to prevent overwrite of each type):

–no-overwrite-files –no-overwrite-directories –no-overwrite-symlinks

If the ‘–shallow’ option is provided, files and directories this depth and below in the directory hierarchy will be represented by compact placeholder files of the form ‘entry.kopia-entry’ instead of being restored. (I.e. setting ‘–shallow’ to 0 will only shallow restore.) Snapshots created of directory contents represented by placeholder files will be identical to snapshots of the equivalent fully expanded tree.

In the expanding-a-placeholder mode:

The source to be restored is a pre-existing placeholder entry of the form ‘entry.kopia-entry’. The target will be ‘entry’. ‘–shallow’ controls the depth of the expansion and defaults to 0. For example:

‘restore d3.kopiadir’

will remove the d3.kopiadir placeholder and restore the referenced repository contents into path d3 where the contents of the newly created path d3 will themselves be placeholder files.

  • show - Displays contents of a repository object.
  • mount - Mount repository object as a local filesystem.

Commands to control HTTP API server.

Commands to manipulate snapshots.

  • snapshot copy-history - Performs a copy of the history of snapshots from another user or host. This command will copy snapshot manifests of the specified source to the respective destination. This is typically used when renaming a host, switching username or moving directory around to maintain snapshot history.

    Both source and destination can be specified using user@host, @host or user@host:/path where destination values override the corresponding parts of the source, so both targeted and mass copy is supported.

    Source: Destination Behavior

    @host1 @host2 copy snapshots from all users of host1 @host1 user2@host2 (disallowed as it would potentially collapse users) @host1 user2@host2:/path2 (disallowed as it would potentially collapse paths) user1@host1 @host2 copy all snapshots to user1@host2 user1@host1 user2@host2 copy all snapshots to user2@host2 user1@host1 user2@host2:/path2 (disallowed as it would potentially collapse paths) user1@host1:/path1 @host2 copy to user1@host2:/path1 user1@host1:/path1 user2@host2 copy to user2@host2:/path1 user1@host1:/path1 user2@host2:/path2 copy snapshots from single path.

  • snapshot move-history - Performs a move of the history of snapshots from another user or host. This command will move snapshot manifests of the specified source to the respective destination. This is typically used when renaming a host, switching username or moving directory around to maintain snapshot history.

    Both source and destination can be specified using user@host, @host or user@host:/path where destination values override the corresponding parts of the source, so both targeted and mass move is supported.

    Source: Destination Behavior

    @host1 @host2 move snapshots from all users of host1 @host1 user2@host2 (disallowed as it would potentially collapse users) @host1 user2@host2:/path2 (disallowed as it would potentially collapse paths) user1@host1 @host2 move all snapshots to user1@host2 user1@host1 user2@host2 move all snapshots to user2@host2 user1@host1 user2@host2:/path2 (disallowed as it would potentially collapse paths) user1@host1:/path1 @host2 move to user1@host2:/path1 user1@host1:/path1 user2@host2 move to user2@host2:/path1 user1@host1:/path1 user2@host2:/path2 move snapshots from single path.

  • snapshot create - Creates a snapshot of local directory or file.

  • snapshot delete - Explicitly delete a snapshot by providing a snapshot ID.

  • snapshot estimate - Estimate the snapshot size and upload time.

  • snapshot expire - Remove old snapshots according to defined expiration policies.

  • snapshot list - List snapshots of files and directories.

  • snapshot migrate - Migrate snapshots from another repository

  • snapshot restore - Restore a directory or a file.

Restore can operate in two modes:

  • from a snapshot: restoring (possibly shallowly) a specified file or directory from a snapshot into a target path. By default, the target path will be created by the restore command if it does not exist.

  • by expanding a shallow placeholder in situ where the placeholder was created by a previous restore.

In the from-snapshot mode:

The source to be restored is specified in the form of a directory or file ID and optionally a sub-directory path.

For example, the following source and target arguments will restore the contents of the ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ directory into a new, local directory named ‘d1’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9 d1’

Similarly, the following command will restore the contents of a subdirectory ‘subdir/subdir2’ under ‘kffbb7c28ea6c34d6cbe555d1cf80faa9’ into a new, local directory named ‘sd2’

‘restore kffbb7c28ea6c34d6cbe555d1cf80faa9/subdir1/subdir2 sd2’

When restoring to a target path that already has existing data, by default the restore will attempt to overwrite, unless one or more of the following flags has been set (to prevent overwrite of each type):

–no-overwrite-files –no-overwrite-directories –no-overwrite-symlinks

If the ‘–shallow’ option is provided, files and directories this depth and below in the directory hierarchy will be represented by compact placeholder files of the form ‘entry.kopia-entry’ instead of being restored. (I.e. setting ‘–shallow’ to 0 will only shallow restore.) Snapshots created of directory contents represented by placeholder files will be identical to snapshots of the equivalent fully expanded tree.

In the expanding-a-placeholder mode:

The source to be restored is a pre-existing placeholder entry of the form ‘entry.kopia-entry’. The target will be ‘entry’. ‘–shallow’ controls the depth of the expansion and defaults to 0. For example:

‘restore d3.kopiadir’

will remove the d3.kopiadir placeholder and restore the referenced repository contents into path d3 where the contents of the newly created path d3 will themselves be placeholder files.

Commands to manipulate snapshotting policies.

  • policy edit - Set snapshot policy for a single directory, user@host or a global policy.
  • policy list - List policies.
  • policy delete - Remove snapshot policy for a single directory, user@host or a global policy.
  • policy set - Set snapshot policy for a single directory, user@host or a global policy.
  • policy show - Show snapshot policy.

Commands to manipulate repository.

Last modified January 1, 0001