Basically guys Im after some pointers in the right direction here.....
I have been asked to write an app that will replicate Word documents in various directories amongst 3 sites that belong to a branch. So basically they want all three sites at some stage or another to have the same versions of files, when users update them.
The plan is to have a client admin tool, where somebody can specify the directories (source and target) and the replication frequency. EG.
Frequency: Every 1/2 hour
We will then have a "watcher" server side util, that with the help of a few api's, will watch these directories, and build up up a log of which files change in these directories.
This Im okay with, but I thought you may need it for a full picture.
The problematic area is the "Replicator", which also needs to be a server side util, preferably running as a service.
This is where Im having problems trying to think of the best way to implement this. As mentioned several directories will potentially have different replicating intervals, so i was thinking of having an apartment threaded util, that the watcher creates a thread for every time interval / directory. But it gets a bit messy then in trying to keep track of which files need replicating as potential we have z files on x threads, which belong to which. So I am a little confused.
Any pointers and / or psuedo code would be great.
If you need anymore info then shout.
PS. Dont worry about two sites making changes to the same file at roughly the same time. We've decided to put both files in a temp dir and send an email to a responsible person so they can sort out the mess!