Created
June 2, 2022 10:01
-
-
Save utkuozdemir/4d9a3ccbcb6dba578665b70d9a16d5e8 to your computer and use it in GitHub Desktop.
Sync current directory to remote using Rsync for remote development
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 | |
IFS=$'\n\t' | |
SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )" | |
LOCAL_DIR=$SCRIPT_DIR | |
REMOTE_SSH_USER=utku | |
REMOTE_SSH_HOST=u-home-pc-realtek-nic | |
REMOTE_DIR=/home/utku/projects/github.com/utkuozdemir | |
rsync -avzh --delete "$LOCAL_DIR" $REMOTE_SSH_USER@$REMOTE_SSH_HOST:$REMOTE_DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Usage:
chmod +x sync.sh
./sync.sh