The Professional Way to Move Files!
TOC PREV NEXT INDEX

Chapter 9: 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.


 

Using the Synchronize Utility


Start the Synchronize Utility by doing one of the following:

Synchronize Dialog


This is the main dialog of the WS_FTP Pro Synchronize utility. When using this dialog, you are creating a control file that will be used to perform the synchronization of the locations that you identify.

The following are the features found on this dialog:

Example


The following is an example of how you might use the WS_FTP
Synchronize Utility.

When you click the Execute button, the control file named ipswitch.ctl (the name is displayed in the title bar for the dialogue) is executed according to the parameters set on the WS_FTP Synchronize Utility screen:

Using a Control File


WS_FTP Pro Synchronize uses 'control files' to store configuration options and settings for your synchronize jobs. This saves you from having to go through setting up a job each time you want to run it.

To create a control file:

  1. Choose a directory for both Location 1 and Location 2. You can type in a local directory in either box, or click the Browse (...) button to choose a remote site from a site profile, or a local folder. Click the Local tab on the Folder Selection dialog to choose a local folder.
  2. Select the options you want to use.
  3. Select the mode you want to execute.
  4. Review the Status and Actions that will perform and make any adjustments you need to make. If you make an adjustment, your status will be changed to Customized.
  5. Identify any Exclusions you may have.
  6. Click Save to save the control file.

You will now be able to use that control file anytime you use Sync.

Exclusions


With the Exclusion system, you can enter a file name, file extension, or search string to have WS_FTP Synchronize ignore any files that match the string. Wildcards (* and ?) can be used for unknown file names or several files of a similar name or type.

To add an exclusion

  1. Click the Add button in the Exclusions section of the dialog. The Exclusion dialog appears.
  2. In the Exclusion dialog, enter what you want to exclude in the Rules box. If you are using the Absolute location type, you can click the Browse (...) button to select the file or folder.
  3. In the Type box, select what type of item you want to apply the exclusion to:
    • Apply to files. If you want to apply the exclusion to files only.
    • Apply to folders. If you want to apply the exclusion to folders only.
    • Apply to both. If you want to apply the exclusion to both files and folders.
    • Absolute location. If you want to apply the exclusion to a specific file or folder in a specific location.
  4. Click OK to add the exclusion to the list.

Exclusion Examples

Here are a few examples of exclusions, followed by an explanation of each.

Absolute file exclusions

Exclusion rule: /mydir/*.exe
Type: Absolute location

This will exclude all .exe files in the mydir remote directory, but the path is taken from the root of the remote system.

Exclusion rule: c:\mydir\*.exe
Type: Absolute location

This will exclude all .exe files in the c:\mydir local directory.

Exclusion rule: /mydir/nextdir/myfil?.*
Type: Absolute location

This will exclude any file beginning with myfil with one arbitrary character and any extension in the directory /mydir/nextdir.

Absolute directory exclusion

Exclusion rule: /m?dir
Type: Absolute location

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.

Exclusion rule: c:\m?dir
Type: Absolute location

This will exclude all directories on the c: drive that match the mask m?dir. The ? is a substitute for any single character.

Relative directory exclusions

Exclusion rule: mydir
Type: Apply to folders

This will exclude any directory named mydir anywhere in the file system.

Exclusion rule: m*ir
Type: Apply to folders

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."

Relative file exclusion

Exclusion rule: mydir\*.exe
Type: Apply to files

This will exclude any .exe files in any directory named mydir anywhere in the file system.

Relative file/folder exclusion

Exclusion rule: ~*
Type: Apply to both

This will exclude any file or folder starting with the ~ character, 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 Synchronize Utility directly from the command line by using the following syntax:

ftpsync 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 2003