Description

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

Practical Usage

Ideally used to replicate folders between a machine and the local network or to backup one or more directories. If specifying a network location, folders should always be specified using UNC (Universal Naming Convention) paths instead of a mapped drive. For example: X:\pathname\ should be \\servername\pathname\. This is because mapped drives are available only when a user is logged on, therefore, tasks set to run in the background when the user is logged off will fail.

Parameters

General Properties

Property

Type

Req'd

Default

Markup

Description

Folder 1

Text

Yes

(Empty)

FOLDER1="c:\firstfoldername\"

The folder that should be synchronized. If synchronization method is set Unidirectional, then files from this folder that do not exist or are newer than their counterparts in Folder 2 will be transferred to the folder specified in the Folder 2 parameter. If synchronization method is set to Bidirectional, then files from folder 2 that are newer or do not exist will be transferred into this folder as well.

Folder 2

Text

Yes

(Empty)

FOLDER2="c:\otherfoldername\"

The destination folder and (optionally) file name that the file(s) should be copied to. This can be a fully qualified path or a file name. Folders that do not exist will be automatically created at runtime.

Synchronization

Text (Options)

Yes

bidirectional

METHOD="uni"

The method by which the files should be synchronized. The available options are:

  • Bidirectional (Default) - The files will be synchronized both ways, from folder1 to folder2 and from folder2 to folder1.

  • Unidirectional - The files will be synchronized one way, from folder1 to folder2.

Advanced Properties

Property

Type

Req'd

Default

Markup

Description

Include Mask(s)

Text

No

*.*

INCLUDE="*.txt"

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

Exclude Mask(s)

Text

No

(Empty)

EXCLUDE="*.doc"

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

Process Subfolders

Yes/No

No

No

SUBFOLDERS="YES"

Specifies whether subfolders and files inside them should be included in the synchronization. If set to YES, subfolders will be included in the synchronization. If set to NO (default), subfolders will not be included.

Exact Copy in Folder 2

Yes/No

No

No

EXACT="YES"

If set to YES, an exact copy of files in Folder1 will be created 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. This parameter is set to NO by default.

Include Read Only

Yes/No

No

No

INCLUDEREADONLY="YES"

Specifies whether files and folders marked as read-only are synchronized. If set to YES,  read-only files and folders are overwritten by the proper source file before the read-only attribute is reset. This parameter is set to NO by default.

 

Description Properties

The Description tab allows you to customize the text description of any step as it appears in the Task Builder's Steps Pane.

More on setting custom step description

Error Causes Properties

The Error Causes tab properties lets you instruct a task step to react only to specific errors or ignore certain errors that should cause it to fail.

More on Error Causes properties

On Error Properties

The On Error tab properties lets you determine what the task should do if a particular step encounters an error as defined in the Error Causes properties.

More about On Error properties

Additional Notes

Expressions, Variables & Functions

A percent sign is used as a special character in AutoMate to indicate the beginning and end of an expression. This allows variables, functions and other expressions to be entered in any text parameter of a task's properties. For example: %1+1% inside a task will resolve to 2 at runtime. A more elaborate example is %FileDateTime(myFile)% which results to the date/time of myFile. To help construct expressions, you can open Expression Builder by clicking the Insert Expression (%) button or by pressing F2.

More on expressions

More on variables

More on functions

More on extended functions
More on the expression builder

Example

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

 

Description: Synchronize folder "C:\Dev" bi-directionally with "C:\Dev2".  Process sub folders.  

 

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

 

↑ Top of Page