Last active
January 7, 2026 04:42
-
-
Save harderthan/d56aaf41bd7836fae011d74d55b46d4b to your computer and use it in GitHub Desktop.
sync to remote with rsync
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| REMOTE_HOST="" | |
| REMOTE_DIR="" | |
| SSH_PORT=22 | |
| rsync -azL --delete \ | |
| -e "ssh -p ${SSH_PORT}" \ | |
| --exclude ".git" \ | |
| --exclude ".venv" \ | |
| --exclude "__pycache__" \ | |
| --exclude "*.pyc" \ | |
| --exclude "build" \ | |
| --exclude ".cache" \ | |
| ./ "${REMOTE_HOST}:${REMOTE_DIR}/" | |
| echo "Synced to ${REMOTE_HOST}:${REMOTE_DIR}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment