public function testRsyncWithTimes() { $rsync = new Rsync(); $rsync->setTimes(true); $expected = "/usr/bin/rsync -La --times /origin /target"; $actual = $rsync->getCommand('/origin', '/target')->getCommand(); $this->assertEquals($expected, $actual); }
public function run($args) { $cli = new CLImate(); $origin = Setting::getSetting('remote:user') . '@' . Setting::getSetting('remote:host') . ':' . Remote::getFilesPath(); $dest = Local::getFilesPath(); if (!file_exists($dest)) { if (!mkdir($dest, 0777, true)) { $cli->error('Could not create local files directory'); return false; } } $rsync = new Rsync(); $rsync->setVerbose(true); $rsync->setExclude(Setting::getSetting('rsync:excludes')); $rsync->sync($origin, $dest); }
public function testRsyncWithRemoveSourceFile() { $rsync = new Rsync(); $rsync->setRemoveSource(true); $expected = "/usr/bin/rsync -La --remove-source-files /origin /target"; $actual = $rsync->getCommand('/origin', '/target')->getCommand(); $this->assertEquals($expected, $actual); }
public function testRsyncWithOptionalParametersString() { $rsync = new Rsync(); $rsync->setOptionalParameters('zp'); $expected = "/usr/bin/rsync -Lzpa /origin /target"; $actual = $rsync->getCommand('/origin', '/target')->getCommand(); }