function drush_core_exec_rsync

8.0.x rsync.core.inc drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE)
6.x rsync.core.inc drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE)
7.x rsync.core.inc drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE)
5.x rsync.core.inc drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE)
master rsync.core.inc drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE)
2 calls to drush_core_exec_rsync()
drush_core_call_rsync in commands/core/rsync.core.inc
Make a direct call to rsync after the source and destination paths have been evaluated.
drush_core_rsync in commands/core/rsync.core.inc
A command callback.

File

commands/core/rsync.core.inc, line 110

Code

function drush_core_exec_rsync($source, $destination, $options, $additional_options = array(), $live_output = TRUE) {
  $ssh_options = drush_get_option_override($additional_options, 'ssh-options', '');
  $exec = "rsync -e 'ssh $ssh_options' $options $source $destination";

  if ($live_output) {
    $exec_result = drush_op_system($exec);
    $result = ($exec_result == 0);
  }
  else {
    $result = drush_shell_exec($exec);
  }

  if (!$result) {
    drush_set_error('DRUSH_RSYNC_FAILED', dt("Could not rsync from !source to !dest", array('!source' => $source, '!dest' => $destination)));
  }

  return $result;
}