HostnExtraHostnExtra Docs

Exclusions

Exclude files and directories from HostnExtra Sync operations.

Exclusions

HostnExtra Sync supports excluding files and directories from synchronization using the --exclude option.

Basic Usage

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude node_modules

Multiple Exclusions

Multiple exclusion patterns can be provided as a comma-separated list.

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude node_modules,.git

For example, this excludes:

node_modules
.git

from the synchronization.

Common Examples

Exclude development dependencies:

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude node_modules

Exclude Git metadata:

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude .git

Exclude multiple directories:

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude node_modules,.git,.cache

Exclusions and --delete

Exclusions also matter when using --delete.

Before performing a destructive synchronization, use a dry run to verify the resulting changes:

hostnextra sync push ./build \
    --to web-prod-01:/var/www \
    --exclude node_modules,.git \
    --delete \
    --dry-run

This lets you inspect the planned synchronization before making changes.

On this page