imanewbe Posted March 24, 2011 Share Posted March 24, 2011 Hey. I am wanting to move a couple of files from my current server to another. If i am uploading the file this is fine but if it is already on the server then im not sure how to move it. When uploading I can just use ftp_put($conn_id, $destination_file, $myFile, FTP_BINARY); What i need to do is figure out how to get a hold of the file and store it in $myFile then this would work fine. Is this possible? Cheers Quote Link to comment Share on other sites More sharing options...
btherl Posted March 25, 2011 Share Posted March 25, 2011 Do you want to move a file from one server to anther? I would recommend downloading it and then uploading it again. Quote Link to comment Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 What i want to do is copy the file to 13 servers. this is very time consuming if i have to manually connect to all 13 servers then upload the file. I want to run a script that copies it to all servers. Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted March 25, 2011 Share Posted March 25, 2011 if its the same file time and time again. it might be easier to setup a CRON, and then on each of the other servers do something similar to what your doing now but intead of put, use get Quote Link to comment Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 Its not the same file again and again. It is multiple files multiple times. Quote Link to comment Share on other sites More sharing options...
monkeytooth Posted March 25, 2011 Share Posted March 25, 2011 I know it costs a little money, but there are FTP programs that have snyc options to sync multiple locations from one server to the other, or from one local point to multiple remote points, that could be an option too.. not exactly sure what your doing or why.. so just throwing random ideas out. Quote Link to comment Share on other sites More sharing options...
imanewbe Posted March 25, 2011 Author Share Posted March 25, 2011 What i want to do is move a file from one server to another. Quote Link to comment Share on other sites More sharing options...
imanewbe Posted March 28, 2011 Author Share Posted March 28, 2011 if its the same file time and time again. it might be easier to setup a CRON, and then on each of the other servers do something similar to what your doing now but intead of put, use get How would i be able to do this for say a whole folder of images. Quote Link to comment Share on other sites More sharing options...
btherl Posted March 28, 2011 Share Posted March 28, 2011 You could have your script use readdir() or glob() to look at each file in turn, and then connect to each ftp server in turn, uploading all the files. That seems like a logical approach to me. Quote Link to comment Share on other sites More sharing options...
imanewbe Posted March 28, 2011 Author Share Posted March 28, 2011 cheers. Thanks for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.