Posted 16 January 2014 - 11:04 PM
(As usual, this is a different type of question; if it's in the wrong forum please move it.)
I own two domains: example.com and example.ru. These sites are essentially mirrors of each other but they provide better geo-awareness than having only one site.
If I have files that I need to copy from example.com to example.ru on a semi-regular basis, how do I do this programmatically? Obviously I have the login credentials, nameservers, IP addresses, and whatever else of both servers. What's the code to accomplish this? I have not ever tried to send files from one server to another. It certainly would be better than FTPing the files down to a local machine and then FTPing back up to the other server.
Posted 17 January 2014 - 12:54 AM
As a second option, regardless of OS, you could always just setup FTP servers on each and create a login for the other server to connect and send a file.
Either of these options could be done directly from PHP code or you could exec() out to an external tool to handle the transfer.
As a third alternative you could setup some kind of periodic sync to keep a certain directory in sync between the two servers. cront + rsync would be one way to handle this. There are other tools out there as well.
Did I help you out? Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
Posted 17 January 2014 - 01:12 AM Best Answer
Ah yes, now I see ftp_connect and a bunch of related ftp_fput and stuff. That's the ticket. Thanks.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users