An update of our software installation packages involves uploading 42 files with sizes that range from 20-120 MB. Each file must be placed in a different directory on our server. An FTP program like FileZilla is useful for day-to-day file updating, but lacks script operation features. In this case, an update would involve a tedious process of identifying 42 files and 42 destinations. The situation is worse if we need to update programs from one of our secondary offices. Local Internet providers severely limit upload speed — the figure is 122 kB/s at our Colorado office.
One solution is to automate the process (i.e., prepare the update files and then let the computer upload autonomously for several hours). WinSCP is a good freeware utility to help implement automated FTP transfers. It is available at http://winscp.net/eng/index.php.
The documentation for WinSCP is a little convoluted, so I prepared an example based on my experience to help you set things up. To begin, download and install WinSCP. For convenience, put c:\program files\winscp on the path. Alternatively, copy the relatively small executable files to a location that is already on the path. I use a general directory c:\batch.
As an example, suppose you have the files
that should be copied to the directories
on your server, automatically replacing any existing files with the same names. Suppose your site has the URL mycompany.com. The user name and password for FTP transfers is myuser and mypassword.
1) Use a text editor to create a file FTPUpload.bat in the directory c:\distfiles with the following single-line content:
winscp.exe /console /script=FTPUpload.txt
The batch file runs WinSCP in the console mode and calls up the script for instructions.
2) Create another file in the directory called FTPUpload.txt with the following content :
option confirm off
The first line opens a password-protected FTP session and transfers to a convenient directory. The second line ensures that the script will not pause for confirmation when replacing the old files. The subsequent lines migrate to directories and copy the appropriate files. Simply run the batch file and everything happens automatically. WinSCP maintains a console window to show the status of operations.
Note: If you are bothered by world-class hackers breaking into your office, be careful about storing the file FTPUpload.txt with your site password.
For information on our finite-elements programs, please see http://www.fieldp.com/order.html.