| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
A command-line utility for syncing a local folder with a remote FTP or SFTP server on every change of files or directories.
Report Bug
·
Request Feature
sftp-sync is a command-line utility for syncing a local folder with a remote FTP or SFTP server on every change of files or directories.
Install the latest version directly from the repository:
go install github.com/capcom6/sftp-sync@latestThis will install sftp-sync to your $GOBIN directory. Make sure your $GOBIN is in your $PATH.
Download the pre-compiled binaries from the GitHub Releases page:
chmod +x sftp-syncsudo mv sftp-sync /usr/local/bin/If you prefer to build from source:
git clone https://github.com/capcom6/sftp-sync.git
cd sftp-sync
make buildThe binary will be available in the bin/ directory.
Run the sftp-sync command with the necessary options and arguments:
FTP:
sftp-sync --dest=ftp://username:password@hostname:port/path/to/remote/folder \
--exclude=.git /path/to/local/folderSFTP (password):
sftp-sync --dest=sftp://username:password@hostname:22/path/to/remote/folder \
--exclude=.git /path/to/local/folderSFTP (SSH key):
sftp-sync --dest="sftp://username@hostname:22/path/to/remote/folder?key=~/.ssh/id_ed25519" \
--exclude=.git /path/to/local/folderSFTP (SSH agent):
sftp-sync --dest="sftp://username@hostname:22/path/to/remote/folder?agent=true" \
--exclude=.git /path/to/local/folderNote: SFTP uses SSH port 22 by default (vs FTP port 21).
The URL path (e.g., /path/to/remote/folder) is used as the remote destination prefix. All synced files and directories are placed relative to this path. The remote directory must already exist before starting the sync.
SFTP URL query parameters:
| Parameter | Description | Example |
|---|---|---|
| key | Path to SSH private key file (supports ~ expansion). If omitted, auto-detects ~/.ssh/id_ed25519, ~/.ssh/id_ecdsa, ~/.ssh/id_rsa | key=~/.ssh/custom_key |
| key_pass | Passphrase for encrypted private keys | key_pass=mysecret |
| agent | Use SSH agent for authentication when set to true | agent=true |
Authentication methods are tried in order: SSH agent → private key → password.
Security note: Avoid putting real passwords/passphrases directly in CLI arguments when possible, as they can be exposed via shell history and process listings.
The application uses structured error handling with specific exit codes:
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open-source community a great place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion to improve this project, please fork the repository and open a pull request. You can also open an issue with the enhancement label.
If this project is useful to you, consider starring it.
Distributed under the Apache License 2.0. See LICENSE for more information.
Project Link: https://github.com/capcom6/sftp-sync
| Back | FazBrowse Home | New Git URL |