Page 1 of 1
Replicating an uploaded file from one server to another
Posted: Wed May 24, 2006 7:46 pm
by phice
How do you guys think i should go along replicating (basically copying) an uploaded file from one server to another (same network I believe) automatically (be it php or another language)? Possibly using PHP's built in FTP functions or something? Basically we've got two servers behind a load balancer and would like to be able to access the file from either server.
Have any of you had this problem or, more rightly named, task?
It'll be on linux servers running through ThePlanet if that helps at all.
Posted: Thu May 25, 2006 1:02 am
by Christopher
You could either copy it after the upload or have a cron running that does regular rsync type updates. It would depend on your specific application which one would be better.
Posted: Thu May 25, 2006 10:14 am
by phice
I'm thinking probably an FTP transfer using PHP since it needs to be done immediately.
I'll look into the rsync method as well and post what I do for future reference.
Posted: Thu May 25, 2006 10:44 am
by timvw
With the ssh extension you can scp too...
Posted: Thu May 25, 2006 12:56 pm
by Christopher
timvw wrote:With the ssh extension you can scp too...
You can also rsync over ssh -- Tim is right to point out that this should be done securely.
Posted: Mon May 29, 2006 4:17 pm
by phice
Now I've got the complete idea for how it's going to be set up.
I've got one linux machine where the uploads will be uploaded onto through an upload box on the website. There are two windows machines that are basically twins and need to have said uploaded file on both servers in the same location. How do you guys suggest I go about doing this? You guys have said Rsync but I have no clue how to set that up on this type of setup.
Posted: Tue May 30, 2006 12:58 am
by Christopher
Google "rsync howto"