build
Create a snapshot of the source database.
clonit build <target> [flags]Arguments
Section titled “Arguments”| Argument | Description | Required |
|---|---|---|
target |
Name of the target to snapshot | Yes |
| Flag | Type | Default | Description |
|---|---|---|---|
--jobs |
int | 0 |
Number of parallel dump jobs (0 = use target default) |
--no-push |
bool | false |
Skip automatic push to storage after build |
Description
Section titled “Description”Creates a new snapshot of the target’s source database using pg_dump in directory format. The snapshot is stored in the configured working directory (~/.clonit by default).
The --jobs flag controls the number of parallel dump jobs. When set to 0, the target’s configured dump_jobs value is used. If that is also 0, pg_dump uses its own default.
Auto-push
Section titled “Auto-push”After a successful build, Clonit automatically pushes the snapshot to cloud storage if:
- The target has a storage profile linked to it
- The
defaults.auto_pushconfig option istrue(the default) - The
--no-pushflag is not set
If the target has no storage profile, auto-push is silently skipped. If the push fails, a warning is printed but the command exits successfully – the snapshot is still available locally and can be retried with clonit push.
To disable auto-push globally, set defaults.auto_push: false in the config file or CLONIT_DEFAULTS__AUTO_PUSH=false in the environment.
Examples
Section titled “Examples”Build a snapshot using target defaults:
clonit build mydbBuild a snapshot with 8 parallel dump jobs:
clonit build mydb --jobs 8Build without auto-pushing to storage:
clonit build mydb --no-pushBuild with debug output:
clonit --debug build production-snap