C.8 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.9: 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
excludeStringExcluded file matching pattern. Use comma separated values to exclude multiple files/directories, e.g.: a,bn/aNo
excludeFileStringExcluded patterns file.n/aNo
backupDirStringCreates a backup so users can rollback to an existing restore point.n/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 transfer.TrueNo
dryRunBooleanThis option makes rsync perform a trial run that doesn't make any changes.FalseNo
itemizeChangesBooleanThis option requests a simple itemized list of the changes that are being made to each file, including attribute changes.FalseNo
checksumBooleanThis option will cause rsync to skip files based on checksum, not mod-time & size.FalseNo
deleteBooleanThis option deletes files that don't exist on sender after transfer including force and ignore-errors.FalseNo
identityFileStringIdentity file for ssh authentication of a remote transfer.n/aNo
portIntegerPort for ssh authentication used by identityFile.22No

C.8.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.