I’m currently using python-inotify to monitor local directories for changes, and run scripts when they happen.
Now though, I need functionality to monitor a remote directory for changes. The remote directory will be either a git or svn repo, on a server I have root ssh access to. I know about git hooks, but they only get run on commit/push/rebase etc, not on generic changes.
Is there an existing python library I might be able to use for this? Or can I just open an ssh connection in Python and then carry on using python-inotify?
You need file system level access for
inotifyto work. So the easiest way if you have ssh is to just run the monitor script on the remote system.You can then use something like Twisted to communicate the changes from one system to another over the network.