I know this is not technically about Perl programming, but I need to know if anyone knows of a good FTP program that will transfer files from a site on one server to another without losing the permissions on the cgi files. It would save me alot of time moving my website to our new server.

I have WS_FTP but don't want to have to individually set the permissions like I do with it. I want to do a site move using an FTP program like FlashFXP found on CNET.com. If WS_FTP can do it, it must be a later version than mine then.

What I am wanting in other words, is to not have to download to my computer and then to my new site, but to just move a large number of files from site to site without losing permissions. I used FlashFXP trying to move my files and it was not only slow but it was also not very accurate. It would send blank files at times. It may be my new server (?).

Anyone know anything about a program that can help me do this let me know.

Since we're on a Perl forum here, what about writing a customized script for that purpose? I think using the Net::FTP package it would be a matter of 100-200 lines of Perl to create an exact copy of a directory structure on another server. You could make connections to both servers, parse the directory listing, extract permission information, recurse through all subdirectories and mirror all files/directories to the other server and chmod them based on the gathered information. At least that's what I would do if I couldn't find any other tool to do it ;-) I've been working with Net::FTP for automated uploads to keep directory structure consistent between my local and server files. I had some other requirements that no other program was capable of, such as automatic modification of certain files before uploading (while not actually modifying the local files) and (also) automatic chmod of new files that had to be executable on the server. The package is really easy to use. If nobody comes up with an alternative solution, I'd give it a try.

I use LeechFTP too. It is good for what i need except i often overload it and it crashes or stops responding :p

Of course Marcus comes in here and says Hey why not program your own! What is the perldoc thing on it( like perldoc ftp) or is there a online documentation of it. How do you people find these documentations so easy, it takes me forever to find the one i want.

Actually, finding the perldocs or a package itself is quite easy if you know the package name. The name of the package I mentioned in my last post is Net::FTP. To get the perldoc if the package is already installed, you just have to type:

Code

perldoc Net::FTP

If the package is not yet installed, go to CPAN Search and enter Net::FTP. You will receive a list of all packages that matched your search, including the Net::FTP and perhaps some related packages. You can also have a view at the online documentation at CPAN before downloading the package. If you don't have the package name and search for something specific, e.g. a package that does telnet, enter telnet at CPAN Search and you will be taken to the Net::Telnet package. You can also browse CPAN by category, for example. The nice thing about the Perl environment is that mostly all resources you need are in one place: CPAN. And it's relatively easy to find something there. As I recently searched for some Perl code to grab the embedded photographic information out of the pictures of my digital camera, I first tried searching CPAN and found the Image::Info module within less than a minute. But not only are mostly all packages available from CPAN, they all share the same installation and documentation process. To view the documentation, you always type perldoc followed by the name of the package.

The FTP freeware "Free Dup" offered at NoNags (http://www.ded.com/nonags/index.html) and downloaded from http://utenti.tripod.it/stefanopp/ has the right idea, but the software itself is almost to simplistic. It needs a way to browse and choose files in the server instead of just typing file names in. Read the description of his software...

I just had another idea how you could possibly solve your problem without a special FTP program. The easiest way would be if you have telnet access to your server. If this is the case, you could simply use tar to create an archive of all your files. Since tar also saves the permissions of the files, you can download that archive, upload it to the other server, and untar the files there. If you don't have telnet access, you can try to run tar from a CGI script. Another possibility would be to use the two scripts I've attached, which I have written quite some time ago because I also don't have telnet access to my server. These two scripts act more or less like a poor man's telnet. I've written them just to browse through the server a little bit. Before I explain exactly what the scripts are doing, I have something important to say: Leaving this script on your server is a very, very high security risk. There's no password or any other kind of protection. Anyone who knows the URL of the script can do just about everything on your server, e.g. delete all your files or even worse. Upload the script, use it, and immediately delete it after usage. Or try to add some security patches. Ok, now what are the scripts doing. The first one is intended to be uploaded to your server. It is invoked like any other CGI script by an HTTP request. It has two parameters, the current working directory and the command to execute. When executing a command, it opens a pipe from the command and returns all it's standard and error output as well as the current working directory via plain text output. The second script is intended to run on your local system. You have to supply the name of your server as the only argument, otherwise it will use localhost. Once you run the script, it requests the current working directory from the CGI script on your server. If it succeeds, you will receive a prompt to enter your commands. You can type 'exit' or 'quit' to exit the program. Please, try to have a look at both scripts first, and -- even more important -- try to understand how dangerous it can be to leave them on your server. You may need to modify the $baseurl in the local script, and I'd recommend not to name the remote script 'exec.cgi'. If you give it a name only you know, it would be a bit safer. Just edit the $baseurl line to contain the new name of the script. There's also some code in there to remove the banner that netfirms.com inserts in every page. You can ignore this, because it won't do any harm if there's no banner. I hope this will help you.