Last active
May 24, 2023 19:27
-
-
Save tureki/10851084 to your computer and use it in GitHub Desktop.
Rsync when file changes on Mac
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
#!/bin/bash | |
#install fswatch | |
brew install fswatch | |
#fswatch to keep a directory in sync with other directory | |
fswatch-run /Users/tureki/Desktop/files/ /Users/tureki/sh/rsync.sh |
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
#!/bin/bash | |
#rsync file to samba volumes | |
rsync -rlHpogDtS --delete /Users/tureki/Desktop/files/ /Volumes/tureki/files/ | |
#rsync file to remote server | |
rsync -rlHpogDtS -e ssh --delete /Users/tureki/Desktop/files/ HOSTNAME:~/files/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment