💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# 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 NameTypeDescriptionDefaultRequired`rsyncPath``String`Path to rsync command./usr/bin/rsyncYes`sourceDir``String`Source directory (use \[user@\]host:path for remote sources).n/aYes`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/aYes`exclude``String`Excluded file matching pattern. Use comma separated values to exclude multiple files/directories, e.g.: a,bn/aNo`excludeFile``String`Excluded patterns file.n/aNo`backupDir``String`Creates a backup so users can rollback to an existing restore point.n/aNo`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`-rpKzNo`verbose``Boolean`This option increases the amount of information you are given during the transfer.TrueNo`dryRun``Boolean`This option makes rsync perform a trial run that doesn't make any changes.FalseNo`itemizeChanges``Boolean`This option requests a simple itemized list of the changes that are being made to each file, including attribute changes.FalseNo`checksum``Boolean`This option will cause rsync to skip files based on checksum, not mod-time & size.FalseNo`delete``Boolean`This option deletes files that don't exist on sender after transfer including `force` and `ignore-errors`.FalseNo`identityFile``String`Identity file for ssh authentication of a remote transfer.n/aNo`port``Integer`Port for ssh authentication used by `identityFile`.22No 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.