Transfer files on folder change three-way

Hi,

I have on one server a folder where files are uploaded to. When a file is uploaded to this folder I want to send it to a second server in a different network.

What's the best way of doing this? FTP, some kind of web-drive, syncing software?

And how do I set it up?

The servers are running Win server 2008 (Source server) and Win server 2003 (Destination server).

The files being sent isn't sensitive, so high security isn't as important as high reliability.
LVL 2
GudorianAsked:
Who is Participating?
 
arnoldCommented:
http://www.codeproject.com/KB/files/MonitorFolderActivity.aspx
http://www.codeproject.com/KB/files/CheckForZipFiles.aspx
http://www.programmersheaven.com/article/100445-Creating+a+Folder+Monitoring+Windows+Service+in+C%23/info.aspx

Are but a few examples.

You could setup a PHP page for internal use where your domain based windows 2008 will connect and check if there are files it should get and then retrieve them.
The push back can be done in the same way.  I.e. you have a process on the win2k8 that connects to a special PHP page and uploads files.  The issue is whether your PHP upload will handle an upload of a filename that already exists.
0
 
Vinchenzo-the-SecondCommented:
Hi,
If the servers are in domain you can use DFS for this.  As soon as the files are uploaded DFS will replicate the files to the destination server

Here is step by step guide from Microsoft:
http://technet.microsoft.com/en-us/library/bb727150.aspx
0
 
GudorianAuthor Commented:
They are not in the same domain
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

 
Vinchenzo-the-SecondCommented:
Are the domains part of the same forest?
0
 
GudorianAuthor Commented:
Source server (2008) isn't part of any domain, it's a VPS hosted by a Web hosting company, the target server (2003) is part of a domain.
0
 
Vinchenzo-the-SecondCommented:
Right, DFS is out of the question then...
0
 
arnoldCommented:
You would need to use something like rsync or setup a vbscript service that will monitor this directory for changes, but the issue is how/what connections you have available on the server to which you want the files copied? FTP, SSH, web upload form?
0
 
GudorianAuthor Commented:
The target server has both web-server(IIS and Apache) and ftp running. Ssh is an option but needs to be set up.
I'm not that familiar in vbscript as c#, but if I'm right they can do the same, but i rather skip the programming.
I havn't used rsync but i'll look it up.
0
 
arnoldCommented:
The mechanism is the same, you would just need to implement it in the language you know.


Either one you would setup a service that will monitor changes in the directory of interest to you. Make sure to check whether the file is no longer being updated before starting transferring.

Is the upload process PHP based? You could at the conclusion of the upload trigger a subsequent upload to the remote server (make sure to respond to the browsing user first so that their session will not be tied up waiting for the transfer to complete).
0
 
GudorianAuthor Commented:
I havn't tried building a services yet, can you recombine any sources looking into to help me get me started?

It is PHP, but I'll probably need to sync files back, and those files won't be uploaded via a php form, so I would like to use the same method both ways.
0
 
GudorianAuthor Commented:
Thank you, I will have a look at both building a service and the php solution and decide on which will be best.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.