I've a load balanced server on production environment for my application. The server is on Windows Server 2008 R2. I'm running a web application that creates and save a file into a folder on the web path. So I need to create a job that copy this file into another server. The main idea is that a file watcher checks for the file and then copy it instantly. But how can I know in what server it's the file?
Please avoid "why you don't" answers to get a directly answer, if it's someone.
Are you able to change the IIS configuration? You could have the folder configured as a virtual directory on all of your NLB nodes that points to a central network location. No code changes required, and all nodes see the same set of files, instantly.
Why don't you use some of the built-in file and folder replication technologies like DFS to replicate and store files automatically. Or better yet reconfigure your web application to store whatever files you have directly to a network storage device instead of locally.