File System - Synchronize Folders

Declaration

<AMFILESYSTEM ACTIVITY="synchronize_folders" FOLDER1="text" 
FOLDER2="text" INCLUDE="text" EXCLUDE="text" 
SUBFOLDERS="YES/NO" INCLUDEREADONLY="YES/NO" />

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.

General Parameters

Property

Type

Required

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 Parameters

Property

Type

Required

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.

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

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 tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Example

The sample AML code below can be copied and pasted directly into the Steps panel 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" />