Last active
December 20, 2022 14:09
-
-
Save lucarin91/294bb88c395df63ca6a768201a9e26c9 to your computer and use it in GitHub Desktop.
Synchronize a local folder with a remote server in a bidirectional way.
This file contains 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
#!/bin/sh | |
set -e | |
### Configuration ### | |
[email protected] | |
REMOTE_FOLDER=my_folder | |
REMOTE_RESULTS=results | |
EXCLUDE_FILES="--exclude=.*\ | |
--exclude=build/" | |
### Remote syncronization ### | |
set -x | |
# Push code to the remote server | |
rsync -avz --delete $EXCLUDE_FILES --exclude=$REMOTE_RESULTS . "$SERVER:$REMOTE_FOLDER" | |
# Pull results from the remote server | |
rsync -avz "$SERVER:$REMOTE_FOLDER/$REMOTE_RESULTS" . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment