Skip to content

Instantly share code, notes, and snippets.

@DeaconDesperado
Last active August 29, 2015 14:01
Show Gist options
  • Save DeaconDesperado/f08faefa3a90b85d75bd to your computer and use it in GitHub Desktop.
Save DeaconDesperado/f08faefa3a90b85d75bd to your computer and use it in GitHub Desktop.
Rsync recipie

#Sync directories on file change:

  • Install watchdog: sudo pip install watchdog
  • Copy the contents of the Makefile in this gist to a file called Makefile in your project folder
  • Change the paths and options in the makefile as needed!
    • user@remotehost should be your user and hostname on the remote machine. Everything after the colon is the filepath on the remote
    • exclude flags can be used to ignore source control or bytecode files
  • Use your new makefile! From the same directory as the Makefile: make watch
watch:
watchmedo shell-command --recursive --command='rsync -avt --delete --exclude '*.pyc' --exclude '.git' . user@remotehost:folder/path'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment