The Professional Way to Move Files!
TOC PREV NEXT INDEX

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:

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:

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\*.exe
 

An explanation of each exclusion follows:

/mydir/*.exe
 

An 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\*.exe 
 

A 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.ctl
 

You 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
TOC PREV NEXT INDEX
©Ipswitch 2001

WS_FTP Pro
Support Center