[an error occurred while processing this directive]
How do I transfer a number of files at once?
There are two methods for transferring files to and from WebCom:
To retrieve all the files ending in "*.html" that are stored in your www directory on WebCom:
Highlight all the files ending in ".html" (hold down your control key, and point and click on each file with your mouse), and select the transfer or copy command or button in your FTP program. The selected files will all be transferred.
If you are using a graphical FTP client, you should be able to select multiple files for transfer by highlighting the ones you want, and selecting the transfer command.
On a Windows machine, for example, holding down the "shift" key while selecting files with the mouse causes all the files between the two files selected with the mouse to be highlighted, while holding down the "control" key causes individual files to be selected. Hold each of these keys down until you have finished selecting files for transfer. If you don't, the next mouse click will cause all the files you have previously highlighted to become unselected.
The exact name of the transfer command will vary with the client you are using, but there should be a button or menu equivalent to "Copy" files from WebCom to your machine, or from your machine to WebCom. You may even be able to merely highlight and "drag" files from one machine to the other.
Command line FTP clients allow you to transfer large numbers of files with a single command. Use "mget" (multiple "get") to transfer multiple files from WebCom to another computer and "mput" (multiple "put") to transfer large numbers from another computer to WebCom. There are two "tricks" to using these commands effectively. The first is selecting files with "wildcards" ("*" and "?"), and the second is turning off the prompt FTP programs are programmed to give before each transfer when using "mput" and "mget". (FTP clients are programmed to do this so that you can stop large transfers in the middle of the process without having to break your connection to the other computer. This is especially useful if you have selected the wrong group of files by accident.)
Wildcards enable you to select the files you want from a listing of files stored in a directory without having to specifically name each one, by allowing you to specify a match pattern instead of a specific filename.
There are two wildcards which you can use with the WebCom FTP Server. "*" and "?". "*" stands for zero or more characters and "?" stands for exactly one character. Some examples are given below.
You can test a wild card pattern before using it for a group transfer by first using it with the "dir" or "ls" file listing commands. If the directory listing lists the correct group of files you are trying to delineate with your pattern, then you are certain that an mget will retrieve those same files.
Here are some examples of wildcard pattern matching:
mput *.html
transfers all the files ending in ".html" in your current local working directory to the current remote (WebCom) directory. For another example, consider the following group of files.:
How would you select all the files in this directory that start with "ftp" and end with ".txt", no matter what is between those characters? ls ftp*.txt is the answer. It will select "ftp_introduction.txt", "ftp1.txt" and "ftp.isverysimple.txt" from the above list of files.
The "?" wildcard is less generally useful, but the following listing demonstrates an example where it comes in handy.
We only to select "ftp_intro2a.html", "ftp_intro2b.html", and "ftp_intro2c.html". Entering ls ftp_intro2*.html would cause all of the files in the listing to be listed. Entering ls ftp_intro2?.html however, selects the proper subset of files.
Of course, the most popular wildcard of all is "*", which will select all the files in a directory in a single stroke.
When doing a mass transfer with a command line client, you may be annoyed to discover that the FTP software asks you to confirm each and every file transfer by typing "y" or "n".
You can avoid this behavior by invoking your client in "non-interactive" mode by using the -i switch on the command line (ftp -i ftp.webcom.com/~webcom) when you connect to WebCom. This will turn off the prompting.
The WebCom FTP Server is capable of receiving and unbundling a single compressed file that contains the contents of an entire directory structure.
The process uses some standard Unix utilities to do this: "tar", "compress", and/or "gzip". In a nutshell, you can upload an entire structure by logging in to the FTP server as you (not as anonymous), uploading a file archive, and then instructing the server to unbundle the archive. Here are the naming conventions for file archives:
Note: Compressed file archives are typically compressed and archived by the appropriate UNIX utilities (gzip, tar, compress). In order to be able to create such an archive of files, your files must either reside on a UNIX system which has these utilities, or you must have versions of the utilities for your computer's operating system (only tar is required for this process, gzip or compress are optional but helpful). (You can create a compressed archive of your WebCom directory with the WebCom FTP server, and download it to your computer for a backup, and use this procedure if you ever wish to restore your account from the backup).
The first step is to create on your local computer the compressed archive of the files and directories you want to upload to WebCom. Here's how to do this from a UNIX shell account (adapted from instructions provided by WebCom user Jim Hurley (hurleyj@webcom.com)):
tar cf www_archive.tar www/*
^ ^ ^
! ! !
! ! +- this is the directory to tar
! +-- this is the name of the tar file archive created
+-- 'cf' means 'create, file'
Next, compress the file for a speedier transfer to WebCom:
gzip -9 www_archive.tar
This will create www_archive.tar.gz with maximum compression (-9).
Alternatively, you could use the UNIX 'compress' utility to compress the archive:
compress www_archive.tar
This will create www_archive.tar.Z.
Now, FTP to ftp.webcom.com/~webcom and change directories to the place where you want the new directory (if you're putting it somewhere other than your home directory).
Make sure your FTP client is in binary mode, and upload the compressed archive file.
Next, instruct the FTP server to decompress the file archive. If you used gzip to compress the archive, send the following command to the FTP server:
quote site exec /bin/ftp-exec/gzip -d www_archive.tar.gz
If you used compress, send the following command to the FTP server:
quote site exec /bin/ftp-exec/compress -d www_archive.tar.Z
(NOTE: if you're using a graphical FTP client, look for a menu item, normally called "Quote", which allows you to send a direct command to the FTP server. After selecting "Quote", your client should prompt you for the command to send. Omit the 'quote' and send the everything from 'site exec' on.)
Now the file 'articles.tar' will be in your FTP directory. The final step is to instruct the FTP server to unbundle the archive:
quote site exec /bin/ftp-exec/tar xf www_compress.tar
Where the c in cvf in stood for 'create' when we created the archive, the x here stands for 'extract'.
If you're using a command line client, you will see the list of files extracted.
Finally, you'll probably want to delete the www_archive.tar file.
To fully grasp the concepts behind this method of uploading a compressed archive to your WebCom account, an introduction to the relevant UNIX utilities is helpful.
Tar, the Unix Tape Archive utility, is the standard Unix file archive utility. It creates a single file (an "archive") into which any number of files can be placed. This utility was originally written for UNIX to allow users to store and restore files from magnetic tape (hence the "Tape Archive" name), but these days (espically on the Internet), tar is more frequently used to bundle a group of disk files and/or directories into a single disk file.
A "tar" file can be stored on any computer, and the files stored within it may be "dearchived" by any computer for which the "tar" utility is available. No tape drive is necessary.
The "tar" utility creates an "archive" into which copies of all of the files in the directory (and any directories underneath this directory) being backed up are placed. This archive usually has a filename ending in ".tar". The ".tar" suffix (such as "files.tar") allows to users to readily identify the file as an "archive" created by the "tar" program. It signifies that the "tar" program must be used to "dearchive" the files contained within "files.tar".
Compress is the standard Unix file compression utility. It analyzes a file for sections which are frequently repeated and substitutes a marker representing these sections where ever they occur. This enables "compress" to create a smaller version of this file which can later be "uncompressed" to its original size without damaging the contents.
Files created by "compress" usually have a ".Z" suffix, which enables users to immediately recognize the file as a compressed file, for which the "compress" program is necessary to restore the file to its original size.
GNU zip is a file compression program created by the Free Software Foundation, a organization whose purpose is to create and distribute software that anyone can use free of charge. "gzip" (GNU software often has a "g" attached to the beginning of the filename, to distinguish it from commercial versions of the same program) uses a more efficient means of analyzing the contents of a file, and thus will create a smaller version of the same file than "compress" would. The files "gzip" produces are generally about 33% smaller than those produced by "compress".
Files created by "gzip" usually have a ".gz" suffix, which enables the file to be immediately recognized as a file created by "gzip", and for which the "gzip" program must be run in order to restore the file to its original state.
A "tar" file can also be compressed, once it has been created. A file of this type will usually end in ".tar.Z" or "tar.gz", which identifies it as an "archive" of files which has also been compressed by either "compress" (the file ends in ".tar.Z") or "gzip" (the file ends in ".tar.gz"). It may also end in ".tgZ" (a "tar" file compressed by "compress") and ".tgz" (a "tar" file compressed by "gzip"). These latter two enable people with computers who cannot create files with more than a single period in them (such as ones using DOS, or Windows) to more easily transfer files.
[an error occurred while processing this directive]