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 |
main()
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
executeCommand() : int
throws |
---|
int
Return code from execution.
getCommand() : string
string
getErrorMessage(int $code) : null|string
int
Error code
null|string
setRsyncPath(string $path) : void
string
setIsRemoteConnection(boolean $isRemote) : void
boolean
setSourceDir(string $dir) : void
string
setOptions(string $options) : void
string
setDestinationDir(string $dir) : void
string
setRemoteHost(string $host) : void
string
setRemoteUser(string $user) : void
string
setRemotePass(string $pass) : void
string
setRemoteShell(string $shell) : void
string
setVerbose(boolean $verbose) : void
boolean
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
setDryRun(boolean $dryRun) : void
boolean
setItemizeChanges($itemizeChanges) : void
setDelete(boolean $delete) : void
boolean
setExcludeFile(string $file) : void
string
setBackupDir($dir) : void
setIdentityFile($identity) : void
setOwningTarget(\Target $target)
getOwningTarget() : \Target
getTaskName() : string
string
Name of this task
setTaskName(string $name) : string
string
string
A string representing the name of this task for log
getTaskType() : string
string
The type of this task (XML Tag)
setTaskType($name)
getRegisterSlot(string $slotName)
string
log(string $msg, integer $level = \Project::MSG_INFO)
string
The message to be logged.
integer
The message's priority at this message should have
setDescription(string $desc)
string
The text describing the task
getDescription() : string
string
The text description of the task
init()
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
throws |
---|
getLocation() : \Location
setLocation(\Location $location)
getRuntimeConfigurableWrapper() : \RuntimeConfigurable
setRuntimeConfigurableWrapper(\RuntimeConfigurable $wrapper)
maybeConfigure()
perform()
setProject(\Project $project)
getProject() : \Project
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