简体   繁体   中英

Transfer files from one ftp to another

I need to transfer file/files from one ftp to another. (automatically, let's say at midnight, when is server is less busy).

My question what my options are?

At the moment I'm reading how to use CRON and looking for php function to transfer files to external, and at the moment I'm not getting very far, I hope it's temporary. Would be nice to hear some advices.

Thank you, Max

The question as stated appears to be about transferring files from one server to another automatically. The fact that these are ftp servers is incidental, since it is a very bad idea to use the same public-facing ftp service that clients use to fetch files to manage replication of said files (ie uploading new files and/or overwriting existing ones) - unless you really don't care about your system being hacked six ways to Sunday. PHP is not actually relevant at all, unless you have requirements that we don't know about from reading your question.

I would start by learning how rdist works . The general problem of synchronizing files across servers is decades old, and rdist has benefitted from a boatload of bugfixes and optimizations during that time. If you have more stringent security requirements (which seems unlikely since you're using ftp servers) then you may need to build a custom solution.

I would personally add a command to execute a shell script that uploads the files to a Cron table. I did a quick googlesearch and found a recursive script that does this. http://bash.cyberciti.biz/backup/copy-all-local-files-to-remote-ftp-server-2/

I do not take credit for the script. Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM