|
|
||||
|
Chapter 8: Synchronizing Files and Folders
The WS_FTP Synchronize Utility lets you synchronize (or "mirror") directory structures between your system and a remote FTP server with minimal intervention.
It lets you keep remote sites up-to-date by automatically uploading files which have changed while deleting files that have been removed from the master directory. This is especially useful for quickly and efficiently updating Web sites.
This chapter gives an overview of the Synchronize Utility and some examples of how you might use it. For detailed instructions on using the Synchronize Utility, start the Synchronize Utility and use its online Help.
A Word of Caution
The Synchronize Utility can easily erase or overwrite large numbers
of files without prompting you.To verify that the Synchronize Utility will do what you want, please run any new control files in "test mode" before running them for real. You can then view the contents of the status window to verify
that the control file will do what you expect.You should look for lines such as:
# deleting filea.ext # sending fileb.ext 19960217/00:00 (19950217/00:00) # receiving filec.ext 19960217/00:00 (19950217/00:00)Using the Synchronize Utility
Start the Synchronize Utility by doing one of the following:
- From the Tools menu, select Synchronize.
- Click the Windows Start button and select Programs -> WS_FTP Pro -> WS_FTP Pro Synchronize Utility.
Example
The following is an example of how you might use the WS_FTP
Synchronize Utility.
![]()
When you click the Go button, the control file named rarmstrong (it is at the end of the path in the Control file name box) is executed according to the parameters set on the WS_FTP Synchronize Utility screen:
- Synchronize makes a connection with the FTP site defined
in the Site name box and logs on with the user name and password supplied.- Once the connection is made, the program navigates to the
`/idstuff' directory on the FTP site and the `C:\docutorials' directory on your PC.- According to the options selected, the FTP site directory is made to mirror the local directory by creating folders not already there, and copying or updating files that need to be changed or added in order to make the directories mirror each other.
- Since the Force update of destination option is selected, all files that do not match are copied over or added regardless of the version date on the destination folder.
- Since the Secure Connection (SSL) option is selected, Synchronize attempts to make an SSL connection with the FTP server, using the settings you set in the SSL Configuration Utility. For more information on SSL see "Chapter 7: SSL Utility". If the SSL Connection fails, the Synchronize job will fail.
- If you want to schedule this task to run at on a regular basis, or at a certain time of day, click the Schedule button. The Schedule Item Properties dialog appears. Use this dialog to set the time, date, and frequency of the synchronize job. For more information on using the WS_FTP Scheduler, see "Using the Scheduler".
Exclusions
WS_FTP Synchronize has the ability to exclude directories and/or files during the synchronize process. This exclusion information is entered in the Exclude box. The entered information is in the form of a comma separated set of values. Spaces are interpreted as part of the exclusion, so do not put spaces after (or before) a comma unless they are part of the files/directories you wish to exclude. Wildcards consisting of * and? can be used in directory and file names. An example of this is shown below:
/mydir/*.exe,mydir\,m*ir\,\m?dir\,/mydir/ nextdir/myfil?.*,mydir\*.exeAn explanation of each exclusion follows:
/mydir/*.exeAn absolute file exclusion. This will exclude all .exe files in the mydir directory, but the path is taken from the root of the file system.
mydir\A relative directory exclusion. This will exclude any directory named mydir anywhere in the file system.
\m?dir\An absolute directory exclusion. This will exclude all directories that match the mask m?dir, but the path is taken from the root of the file system. The ? is a substitute for any single character.
m*ir\A relative directory exclusion. This will exclude any directory that matches the mask m*ir from anywhere in the file system. The * means that the name can have any number and value of character in between the "m" and the "ir."
/mydir/nextdir/myfil?.*An absolute file exclusion. This will exclude any file beginning with myfil with one arbitrary character and any extension in the directory /mydir/nextdir.
mydir\*.exeA relative file exclusion. This will exclude any .exe files in any directory named mydir anywhere in the file system.
Using the Synchronize Utility from the Command Line
The Synchronize Utility has been designed to be a command line utility that can be scheduled and run unattended. To do this, you must first use the user interface to set up and test a control file for the synchronization task.
Once this has been done, you can run the Synchrionize Utility directly from the command line by using the following syntax:
ftpsync -f controlfile.ctlYou can also add this command to a batch file and schedule it using WS_FTP Pro Scheduler. For more information on using command line batch files, see "Using a Batch File". For more information on using the WS_FTP Scheduler, see "Using the Scheduler".
|
Ipswitch, Inc. http://www.ipswitch.com |
| ©Ipswitch 2001 | |||