PHP Class Robo\Task\Remote\Rsync

php $this->taskRsync() ->fromPath('src/') ->toHost('localhost') ->toUser('dev') ->toPath('/var/www/html/app/') ->remoteShell('ssh -i public_key') ->recursive() ->excludeVcs() ->checksum() ->wholeFile() ->verbose() ->progress() ->humanReadable() ->stats() ->run(); You could also clone the task and do a dry-run first: php $rsync = $this->taskRsync() ->fromPath('src/') ->toPath('example.com:/var/www/html/app/') ->archive() ->excludeVcs() ->progress() ->stats(); $dryRun = clone $rsync; $dryRun->dryRun()->run(); if ('y' === $this->ask('Do you want to run (y/n)')) { $rsync->run(); }
Inheritance: extends Robo\Task\BaseTask, implements Robo\Contract\CommandInterface, use trait Robo\Common\ExecOneCommand
Show file Open project: codegyre/robo

Protected Properties

Property Type Description
$command string
$fromHost string
$fromPath string
$fromUser string
$toHost string
$toPath string
$toUser string

Public Methods

Method Description
__construct ( )
archive ( )
checksum ( )
compress ( )
delete ( )
dryRun ( )
exclude ( array | string $pattern )
excludeFrom ( string $file )
excludeVcs ( ) Excludes .git, .svn and .hg items at any depth.
filesFrom ( string $file )
filter ( array | string $pattern )
fromHost ( string $fromHost )
fromPath ( string | array $path ) This can either be a full rsync path spec (user@host:path) or just a path.
fromUser ( string $fromUser )
getCommand ( ) : string Returns command that can be executed.
group ( )
humanReadable ( )
includeFilter ( array | string $pattern )
init ( ) : static
itemizeChanges ( )
owner ( )
progress ( )
recursive ( )
remoteShell ( string $command )
run ( )
stats ( )
timeout ( integer $seconds )
times ( )
toHost ( string $toHost )
toPath ( string $path ) This can either be a full rsync path spec (user@host:path) or just a path.
toUser ( string $toUser )
verbose ( )
wholeFile ( )

Protected Methods

Method Description
getFromPathSpec ( $from ) : string
getPathSpec ( string $host, string $user, string $path ) : string
getToPathSpec ( ) : string

Method Details

__construct() public method

public __construct ( )

archive() public method

public archive ( )

checksum() public method

public checksum ( )

compress() public method

public compress ( )

delete() public method

public delete ( )

dryRun() public method

public dryRun ( )

exclude() public method

public exclude ( array | string $pattern )
$pattern array | string

excludeFrom() public method

public excludeFrom ( string $file )
$file string

excludeVcs() public method

Excludes .git, .svn and .hg items at any depth.
public excludeVcs ( )

filesFrom() public method

public filesFrom ( string $file )
$file string

filter() public method

public filter ( array | string $pattern )
$pattern array | string

fromHost() public method

public fromHost ( string $fromHost )
$fromHost string

fromPath() public method

In case of the former do not specify host and user.
public fromPath ( string | array $path )
$path string | array

fromUser() public method

public fromUser ( string $fromUser )
$fromUser string

getCommand() public method

This method is used to pass generated command from one task to another.
public getCommand ( ) : string
return string

getFromPathSpec() protected method

protected getFromPathSpec ( $from ) : string
return string

getPathSpec() protected method

protected getPathSpec ( string $host, string $user, string $path ) : string
$host string
$user string
$path string
return string

getToPathSpec() protected method

protected getToPathSpec ( ) : string
return string

group() public method

public group ( )

humanReadable() public method

public humanReadable ( )

includeFilter() public method

public includeFilter ( array | string $pattern )
$pattern array | string

init() public static method

public static init ( ) : static
return static

itemizeChanges() public method

public itemizeChanges ( )

owner() public method

public owner ( )

progress() public method

public progress ( )

recursive() public method

public recursive ( )

remoteShell() public method

public remoteShell ( string $command )
$command string

run() public method

public run ( )

stats() public method

public stats ( )

timeout() public method

public timeout ( integer $seconds )
$seconds integer

times() public method

public times ( )

toHost() public method

public toHost ( string $toHost )
$toHost string

toPath() public method

In case of the former do not specify host and user.
public toPath ( string $path )
$path string

toUser() public method

public toUser ( string $toUser )
$toUser string

verbose() public method

public verbose ( )

wholeFile() public method

public wholeFile ( )

Property Details

$command protected property

protected string $command
return string

$fromHost protected property

protected string $fromHost
return string

$fromPath protected property

protected string $fromPath
return string

$fromUser protected property

protected string $fromUser
return string

$toHost protected property

protected string $toHost
return string

$toPath protected property

protected string $toPath
return string

$toUser protected property

protected string $toUser
return string