I have a tool that I use during development for syncing the code I am writing on my laptop with my test environment on a remote host. This allows me to quickly test changes without having to git-commit/push/pull/build etc. It is implemented with fswatch and rsync, so it will automatically stream changes I make locally to my remote environment. However, I have a problem because sometimes I forget to turn this tool on and then I waste more time than I should figuring out why my code is not working.
- Is there a programatic way on my remote host to detect that any files have recently (say, in the last minute) been rsync'd to it?
- Furthermore, is it possible to tell that my tool is the one doing the rsync-ing? It is unlikely that any other hosts would be syncing to my remote since I own it, but the more robust the better :)
My end goal is to make a small daemon on the remote host that would do something innocuous like change the prompt color when my file syncing is working.
ps -elf | grep your_tool_name_here
and set an indicator if the tool is running. I do something similar with my bash prompt to let me know which chef environment I'm working in. I use the git_prompt framework. – Michael J Jan 30 '17 at 23:56