Sync Targets
Configure local and remote synchronization targets.
Sync Targets
HostnExtra Sync supports local-to-remote and remote-to-local synchronization using SSH targets.
A remote target uses the following format:
HOST:/REMOTE/PATHLocal to Remote
Push a local directory to a remote server:
hostnextra sync push ./build --to web-prod-01:/var/wwwThe local directory is:
./buildThe remote destination is:
web-prod-01:/var/wwwRemote to Local
Pull a remote directory to the local machine:
hostnextra sync pull web-prod-01:/var/www/build --to ./backupDirect SSH Targets
You can specify the SSH user and hostname directly:
hostnextra sync push ./build \
--to [email protected]:/var/wwwThis does not require the HostnExtra SSH Config plugin.
HostnExtra SSH Config
HostnExtra Sync can use server definitions from the HostnExtra SSH Config plugin.
For example:
hostnextra sync push ./build \
--to web-prod-01:/var/wwwWhen the SSH Config plugin is available, HostnExtra Sync can use configured SSH connection information such as:
- Host
- User
- Port
- Identity file
- ProxyJump
The SSH Config plugin is optional.
Direct SSH targets work independently.
Remote rsync
The remote server must have rsync installed.
HostnExtra Sync checks remote rsync availability before starting synchronization.
If rsync is unavailable, install it on the remote server using the appropriate package manager.
Ubuntu / Debian
sudo apt install rsyncRHEL / Rocky / AlmaLinux / Fedora
sudo dnf install rsyncArch Linux
sudo pacman -S rsync