Last active
October 3, 2018 12:06
-
-
Save pzelasko/bd94447d5aa50e38cdc81c61926f946b to your computer and use it in GitHub Desktop.
Shell utility for continuously synchronizing two directories (possibly local and remote)
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 | |
if [ $# -ne 2 ]; then | |
echo "Usage:" | |
echo "dirsync <source> <target>" | |
fi | |
while inotifywait -r -e modify,create,delete "$1"; do | |
rsync -avz "$1" "$2" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment