Created
October 18, 2017 08:45
-
-
Save porfirion/1d5f5c5c6d6583a93020a6a1d3973875 to your computer and use it in GitHub Desktop.
Watch folder and rsync it on change
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 | |
cd /path/to/project | |
while [ 1 ]; do | |
inotifywait --exclude '.git' -r -e modify,moved_to,moved_from,move,create,delete ./ | |
rsync -ah --exclude='.git/' ./ server:/dev/shm/projectname/ --delete | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
/dev/shm - папка, которая находится в памяти. После перезагрузки всё содержимое исчезает