Created
May 28, 2018 11:21
-
-
Save ryought/cb7d6ae700261991080342644118ce67 to your computer and use it in GitHub Desktop.
ssh先のフォルダとの相互rsyncを変更を感知して自動でrsyncする
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/bash | |
set -Ceu | |
DEST='remote:/dir/to/folder/' | |
EXCLUDE=".git/ heavyfolder/" | |
EXCLUDECMD='' | |
for file in $EXCLUDE | |
do | |
EXCLUDECMD+="--exclude '$file' " | |
done | |
CMD="rsync -av -e ssh . $DEST --update --exclude 'autosync.sh' $EXCLUDECMD \ | |
&& rsync -av -e ssh $DEST . --update --exclude 'autosync.sh' $EXCLUDECMD" | |
watchman-make -p '**/*' --run "$CMD" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment