C.12 FileSyncTask
Prev | Appendix C. Optional tasks | Next

## C.12 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.13: Attributes

Name | Type | Description | Default | Required
--- | --- | --- | --- | ---
`rsyncPath` | `String` | Path to rsync command | /usr/bin/rsync | Yes
`sourceDir` | `String` | Source directory (use [user@]host:path for remote sources) | n/a | Yes
`destinationDir` | `String` | Destination 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/a | Yes
`excludeFile` | `String` | Excluded patterns file | n/a | No
`backupDir` | `String` | Creates a backup so users can rollback to an existing restore point | n/a | No
`options` | `String` | Any 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` | -rpKz | No
`verbose` | `Boolean` | This option increases the amount of information you are given during the transfer | True | No
`dryRun` | `Boolean` | This option makes rsync perform a trial run that doesn't make any changes | False | No
`itemizeChanges` | `Boolean` | This option requests a simple itemized list of the changes that are being made to each file, including attribute changes | False | No
`checksum` | `Boolean` | This option will cause rsync to skip files based on checksum, not mod-time & size | False | No
`delete` | `Boolean` | This option deletes files that don't exist on sender after transfer including `force` and `ignore-errors` | False | No
`identityFile` | `String` | Identity file for ssh authentication of a remote transfer | n/a | No

### C.12.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.

Prev | Up | Next
C.11 FileSizeTask | Home | C.13 FtpDeployTask