-
replication
scenario:
-folder x resides on server a, server b ,server c
-x contains same set of files in a,b,c
whenever any file gets modified in a, it should get also modified in b and c as well
similarly b->a,c and c->a,b
my idea of implementaion is
-when ever any file is modified on a server, compare timestamps and force copy the modified in the other two
How should i go for implementing it?
1)how to check if a file is modified
2)how often this check should be done and how this should be implemented
should a service be running to perform thi check
i want to do this using .NET
Let me know your thoughts and suggestions
-
Re: replication
You may try using the FileSystemWatcher class. Here is a sample.
-
Re: replication
Use FSW and to make it more robust, use an MSMQ or BizTalk or something reliable for message queueing. The problem with FSW is that it is not entirely reliable if you attempt to start copying the file over immediately, especially if a large file is still being written to disk or if another process has a lock on it.
-
Re: replication
@dee u
good article. i have follwed the steps in the article you mentioned but i have the following error
"Cross-thread operation not valid: Control 'txt_folderactivity' accessed from a thread other than the thread it was created on"
any thoughts?
-
Re: replication
The error is very straightforward. You are trying to access the textbox from a thread other than the UI thread. I'm going to guess this has to do with the FSW being triggered. Take a look at this tutorial for accessing controls across threads.