C.11 FileSyncTask

Syncs files or directories using the rsync command. Syncing can be done on the same server or from/to a remote server.

Table C.11: Attributes

NameTypeDescriptionDefaultRequired
rsyncPathStringPath to rsync command/usr/bin/rsyncYes
sourceDirStringSource directory (use [user@]host:path for remote sources)n/aYes
destinationDirStringDestination directory (use [user@]host:path for remote destinations). Note: sub directories are created by default if they do not exist in the destination directory.n/aYes
excludeFileStringExcluded patterns filen/aNo
backupDirStringCreates a backup so users can rollback to an existing restore pointn/aNo
optionsStringAny options that rsync supports, removes the default options. Should you wish to change the port ssh uses for remote transfers, set this attribute to -e 'ssh -p XXXXX' -rpKzl-rpKzNo
verboseBooleanThis option increases the amount of information you are given during the transferTrueNo
dryRunBooleanThis option makes rsync perform a trial run that doesn't make any changesFalseNo
itemizeChangesBooleanThis option requests a simple itemized list of the changes that are being made to each file, including attribute changesFalseNo
checksumBooleanThis option will cause rsync to skip files based on checksum, not mod-time & sizeFalseNo
deleteBooleanThis option deletes files that don't exist on sender after transfer including force and ignore-errorsFalseNo
identityFileStringIdentity file for ssh authentication of a remote transfern/aNo

C.11.1 Examples

<filesync sourcedir="/var/www/development/project1" destinationdir="/var/www/project1" />

<filesync sourcedir="host::module" destinationdir="/var/www/project1/" />

<filesync
  sourcedir="/var/www/development/project1"
  destinationdir="user@server:/var/www/project1"
  dryrun="true"
  itemizechanges="true"
  verbose="true"
  checksum="true" />

In the sourcedir and destinationdir properties user name for remote connections is optional.