Skip to content

Instantly share code, notes, and snippets.

@paulborm
Last active January 21, 2022 10:54
Show Gist options
  • Save paulborm/d8a2cf8c34a1ed6dda490b3e9e93149d to your computer and use it in GitHub Desktop.
Save paulborm/d8a2cf8c34a1ed6dda490b3e9e93149d to your computer and use it in GitHub Desktop.
Rsync deploy script
DEPLOY_USER=""
DEPLOY_HOST=""
DEPLOY_HOST_DIR=""
DEPLOY_LOCAL_DIR=""
DEPLOY_EXCLUDE=""
#!/bin/sh
source .env
echo "🚀 Deploying to remote server ... \n"
# Ref: https://ss64.com/bash/rsync.html
rsync -avz --delete --exclude ${DEPLOY_EXCLUDE} ${DEPLOY_LOCAL_DIR} ${DEPLOY_USER}@${DEPLOY_HOST}:~/${DEPLOY_HOST_DIR}
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment