Created
April 27, 2023 13:25
-
-
Save zaxo7/c267cb632edaa7482068e9ea21d532be to your computer and use it in GitHub Desktop.
a script to continiously sync directories between two hosts
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
#in this example i am trying to sync my current directory to the /var/www on the remote | |
#note: to avoid typing password at each time i suggest enabling public key authentification by ssh-copy-id root@host | |
#i use this setup when working in embedded devices it makes life easier | |
while true; do | |
inotifywait -r . -e modify,create,delete | |
rsync -avzz --exclude 'sync.sh' --delete --update . [email protected]:/var/www/ | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment