Sunday, February 14, 2010

Upload a tree of files and subdirectory to a remote FTP server

I've recently been asked to move a site (1Gb of files) from a Italian hosting linux (no ssh) to the same cheap hosting but to another server windows (damn ! no ssh, no console commands from PHP, the only way to upload files is the old slow uncool FTP).

Problem: I've got an extremely poor upload bandwith in my house in UK. So, I've used another hosting with SSH (dreamhost, in US) and:
1) got data from the 1st hosting (step1). Uploaded a php files that runs "tar -cf all.tar *"m, executed a "wget" to get the tarball, extracted the tarball.
2) uploaded to the second Italian windows hosting (step2).
ncftpput -R -v -u "username" ftp.site2.it /fpt-root-folder .

Weird tricky situation, isn't it ?

No comments:

Post a Comment

 

PHP and tips|PHP