Synchronize Folders Action

Declaration

<AMSYNCFOLDERS FOLDER1="text" FOLDER2="text" INCLUDE="text" EXCLUDE="text" METHOD="text [options]" EXACTCOPY="yes/no" SUBFOLDERS="yes/no">

See Also

Synchronize Folders-Setting Properties, Copy File, Move File, Delete File, Delete Folder, Rename Folder

Description

Synchronizes two folders either uni-directionally (one-way) or bi-directionally (both ways).

Practical Usage

Usually used replicate folders between a machine and the local network or to backup a folder.

Parameters

General Tab

Folder 1

Text, Required
MARKUP: FOLDER1="c:\firstfoldername\"

Specifies a folder that should be synchronized. If Method [METHOD] is set 'UNI' to then files from this folder that do not exist or are newer than their counterparts in folder2 [FOLDER2] will be tranferred to the folder specified in the Folder2 [FOLDER2] parameter. If Method [METHOD] is set to 'BI' then files from folder 2 that are newer or do not exist will be transferred into this folder as well.

Folder 2

Text, Required
MARKUP: FOLDER2="c:\otherfoldername\"

Specifies the file(s) to that should be affected by the attribute change. This can be a fully qualified path and filename (preferred) or a single file (requires use of the Change Folder action). Wildcards ( e.g. *.* or ? ) may be used to rename files matching a certain mask. Multiple file and/or file masks may be specified by separating the entries with the | symbol.

Include Mask(s)

Text, Optional - Default "*.*"
MARKUP: INCLUDE="*.txt"

Specifies a wildcard mask (such as * or ?) representing the files that should be synchronized. The default of *.* includes all files.

Exclude Mask(s)

Text, Optional - Default (none)
MARKUP: EXCLUDE="*.doc"

Specifies a wildcard mask (such as * or ?) representing the files that should not be synchronized. If left blank no files are ignored.

Synchronization Method

Text, Optional - Default (none)
MARKUP: METHOD="uni"

Specifies the method by which the files should be synchronized.

The available options are:

Process Read-Only

Yes/No, Optional - Default NO
MARKUP: INCLUDEREADONLY="YES"

Specifies whether files and folders marked as read-only are synchronized.  If enabled, read-only files and folders are overwritten by the proper source file before the read-only attribute is reset.

Process Subfolders

Yes/No, Optional - Default NO
MARKUP: SUBFOLDERS="YES"

Specifies whether subfolders and files inside them should be included in the synchronization.

Exact Copy in Folder 2

Yes/No, Optional - Default NO
MARKUP: EXACT="YES"

When enabled, an exact copy of files in Folder1 will be made in Folder2.  Files and folders that exist in Folder2 but do not exist in Folder1 are removed.  If a newer version of the file or folder exists in Folder1, it will be copied to Folder2.

Notes

Custom Description

This action includes the Description tab for entering a custom step description.

More on setting custom step description

Standard Error Handling Options

This action also includes the standard Error Causes and On Error failure handling options/tabs.

More on Error Handling Options

Variables and Expressions

All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.

More on variables
More on expressions

More on the expression builder

Example

NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.

<AMSYNCFOLDERS FOLDER1="C:\Dev" FOLDER2="C:\Dev2" SUBFOLDERS="YES" INCLUDEREADONLY="YES" />