You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

26 lines
526 B

<?php
namespace App\Services;
use AFM\Rsync\Rsync;
class DistributeTaskService {
public function syncData($originDir, $targetDir)
{
$config = array(
'delete_from_target' => true,
'ssh' => array(
'host' => 'myhost.com',
'private_key' => '/my/key'
)
);
$rsync = new Rsync($config);
// change options programatically
$rsync->setFollowSymlinks(false);
$rsync->sync($originDir, $targetDir);
}
}