Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- USER="remote_user_here"
- SERVER="remote_server_here"
- LOCAL_DIR="/local/dir/here/"
- REMOTE_DIR="/remote/dir/here/"
- PEM_LOCATION="/path/to/local/key.pem"
- # Open VSCode with your files.
- code $LOCAL_DIR
- # Start fswatch, wait for changes in your local dir and then execute rsync.
- # NOTE: Syncs remotely as apache user.
- fswatch -o $LOCAL_DIR | xargs -n1 -I{} rsync -avzh -e "ssh -i $PEM_LOCATION" \
- --include=".htaccess" \
- --exclude=".*" \
- --exclude=".*/" \
- --exclude="*.orig" \
- --rsync-path="sudo -Hu apache rsync" $LOCAL_DIR $USER@$SERVER:$REMOTE_DIR
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement