Heh. If you feel you must. Some things that you will want to make sure that your inotify and rsync script handles (this is the “why syncing is more difficult than it looks” list, and every one of them is something we tripped over and eventually fixed at U1, which is why the prototype of U1 file sync took a week to build and the product took three years):
- Have syncing happen between two nodes; take both nodes offline; change the same file on both nodes in different ways; bring both nodes back online; have the sync thing mark the file somehow as in conflict and give me the user a way to resolve that conflict on either machine
- Mark ~/stuff as a synced directory. Mount a USB stick full of data at ~/stuff/usb. Wait for the syncer to sync all the files on the USB stick to node 2. Unmount the USB stick. Does the syncer now delete all those files from node 2? It should; they’re gone, after all. But that’s unnecessarily customer-data-destructive. Handle this situation in a sensible way. Alternatively, you may declare that you don’t sync the content of mounted folders: so detect mounted folders accurately, and justify your choice to users.
- Make it obvious to a user whether a file that they have just changed is synced to the other node.
All of these are actually important. “Notice that a file has changed and copy it to another node” is about 15% of the problem, which is what I’m trying to tell you.