Skip to content

Instantly share code, notes, and snippets.

@porfirion
Created October 18, 2017 08:45
Show Gist options
  • Save porfirion/1d5f5c5c6d6583a93020a6a1d3973875 to your computer and use it in GitHub Desktop.
Save porfirion/1d5f5c5c6d6583a93020a6a1d3973875 to your computer and use it in GitHub Desktop.
Watch folder and rsync it on change
#!/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
@porfirion
Copy link
Author

/dev/shm - папка, которая находится в памяти. После перезагрузки всё содержимое исчезает

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment