Skip to content

% zelta-clone(8) | System Manager's Manual

NAME

zelta clone - perform a recursive clone operation

SYNOPSIS

zelta clone [OPTIONS] source[@snapshot] target

zelta clone [OPTIONS] source target origin-backup target-backup

DESCRIPTION

zelta clone performs a recursive zfs clone operation on a dataset. This is useful for recursive duplication of dataset trees and backup inspection and recovery of files replicated with zelta backup. The clones will reference the latest or indicated snapshot, and consume practically no additional space. Clones can be modified and destroyed without affecting their origin datasets.

The source and target must be on the same host and pool. The mountpoint will be inherited below the target parent (as provided by zfs clone). The target dataset must not exist. To create a clone on a remote host, ensure the source and target are identical including the username and hostname used.

With four endpoints, zelta clone first creates the local clone, snapshots the new clone, then backs up that clone to target-backup using origin-backup as the replicated origin. This preserves incremental backup continuity for newly cloned datasets without sending a full backup.

Remote endpoint names follow scp(1) conventions. Dataset names follow zfs(8) naming conventions.

Example remote operation:

zelta clone backup@host1.com:tank/zones/data backup@host1.com:tank/clones/data

OPTIONS

Endpoint Arguments (Required)

source
A dataset, in the form pool[/dataset][@snapshot], which will be cloned along with all of its descendants. If a snapshot is not given, the most recent snapshot will be used.
target
A dataset on the same pool as the source, where the clones will be created. This dataset must not exist.
origin-backup
The backup-side dataset corresponding to source. Used only with the four-endpoint form.
target-backup
The backup destination for target which will be created. Used only with the four-endpoint form.

Output Options

-v, --verbose
Increase verbosity. Specify once for operational detail, twice (-vv) for debug output.
-q, --quiet
Decrease log level. Specify once to suppress notices, twice (-qq) to suppress warnings.
-n, --dryrun, --dry-run
Display zfs commands without executing them.

Snapshot Options

--snapshot, --snapshot-always
Ensure a snapshot before cloning.
--snap-name NAME
Specify snapshot name. Use $(command) for dynamic generation. Default: $(date -u +zelta_%Y-%m-%d_%H.%M.%S).
--snap-prefix PREFIX
Prefix generated snapshot names. If the resolved name starts with zelta, PREFIX replaces zelta; otherwise PREFIX is prepended verbatim.

Dataset Options

-d, --depth LEVELS
Limit recursion depth. For example, a depth of 1 includes only the specified dataset.

EXAMPLES

Clone a dataset tree:

zelta clone tank/vm/myos tank/temp/myos-202404

Clone a dataset tree and add a backup for the clone using the existing origin backup:

zelta clone sink/source sink/target tank/source tank/target

Recover a dataset tree, in place, to a previous snapshot's state:

zfs rename tank/vm/myos tank/Archives/myos-202404
zelta clone tank/Archives/myos-202404@goodsnapshot tank/vm/myos

Dry run to display the zfs clone commands without executing them:

zelta clone -n tank/source/dataset tank/target/dataset

EXIT STATUS

Returns 0 on success, non-zero on error.

NOTES

See zelta-options(7) for environment variables and zelta.env configuration.

SEE ALSO

zelta(8), zelta-options(7), zelta-backup(8), zelta-match(8), zelta-policy(8), zelta-revert(8), zelta-rotate(8), ssh(1), zfs(8), zfs-clone(8), zfs-promote(8)

AUTHORS

Daniel J. Bell _bellhyve@zelta.space_

WWW

https://zelta.space