The FileSyncTask class copies files either to or from a remote host, or locally on the current host. It allows rsync to transfer the differences between two sets of files across the network connection, using an efficient checksum-search algorithm.
There are 4 different ways of using FileSyncTask:
This is extended from Federico's original code, all his docs are kept in here below.
author |
Federico Cargnelutti fede.carg@gmail.com |
---|---|
author |
Anton Stöckl anton@stoeckl.de |
version |
$Revision$ |
package |
phing.tasks.ext |
see | |
example |
executeCommand() : integer
throws | |
---|---|
integer
Return code from execution.
getCommand() : string
string
getDescription() : string
string
The text description of the task
getErrorMessage(integer $code) : null|string
integer
Error code
null|string
getLocation() : \Location
getOwningTarget() : \Target
getProject() : \Project
getRegisterSlot(string $slotName) : \RegisterSlot
getRuntimeConfigurableWrapper() : \RuntimeConfigurable
getTaskName() : string
string
Name of this task
getTaskType() : string
string
The type of this task (XML Tag)
init()
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
throws | |
---|---|
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
main()
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
maybeConfigure()
perform()
throws | |
---|---|
setBackupDir( $dir) : void
setChecksum(boolean $checksum) : void
Without this option, rsync uses a "quick check" that (by default) checks if each file’s size and time of last modification match between the sender and receiver. This option changes this to compare a 128-bit checksum for each file that has a matching size.
boolean
setDelete(boolean $delete) : void
boolean
setDescription(string $desc)
string
The text describing the task
setDestinationDir(string $dir) : void
string
setDryRun(boolean $dryRun) : void
boolean
setExcludeFile(string $file) : void
string
setIdentityFile( $identity) : void
setIsRemoteConnection(boolean $isRemote) : void
boolean
setItemizeChanges(boolean $itemizeChanges) : void
boolean
setLocation(\Location $location)
setOptions(string $options) : void
string
setOwningTarget(\Target $target)
setProject(\Project $project) : void
setRemoteHost(string $host) : void
string
setRemotePass(string $pass) : void
string
setRemoteShell(string $shell) : void
string
setRemoteUser(string $user) : void
string
setRsyncPath(string $path) : void
string
setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)
setSourceDir(string $dir) : void
string
setTaskName(string $name) : string
string
string
A string representing the name of this task for log
setTaskType( $name)
setVerbose(boolean $verbose) : void
boolean
rsyncPath : string
var |
---|
string
sourceDir : string
For remote sources this must contain user and host, e.g.: user@host:/my/source/dir
var |
---|
string
destinationDir : string
For remote targets this must contain user and host, e.g.: user@host:/my/target/dir
var |
---|
string
remoteHost : string
var |
---|
string
remoteUser : string
var |
---|
string
remotePass : string
var |
---|
string
remoteShell : string
var |
---|
string
excludeFile : string
var |
---|
string
backupDir : string
var |
---|
string
defaultOptions : string
r - recursive p - preserve permissions K - treat symlinked dir on receiver as dir z - compress l - copy symlinks as symlinks
var |
---|
string
isRemoteConnection : boolean
var |
---|
boolean
verbose : boolean
var |
---|
boolean
dryRun : boolean
var |
---|
boolean
itemizeChanges : boolean
var |
---|
boolean
checksum : boolean
var |
---|
boolean
delete : boolean
var |
---|
boolean
identityFile : string
var |
---|
string
description : string
var |
---|
string
taskType : string
var |
---|
string
taskName : string
var |
---|
string
project : \Project