function drush_get_runner

8.0.x drush_get_runner($source, $destination)
master drush_get_runner($source, $destination, $runner = FALSE)

Decide on which side to run a core-rsync.




$runner Where to run the rsync operation: 'destination', 'source',: 'auto' ('destination' if both are remote, otherwise '@self') or FALSE (@self)

Return value


2 calls to drush_get_runner()
drush_config_pull in commands/core/
Config pull command callback
drush_sqlsync_sql_sync in commands/sql/


includes/, line 2301
The site alias API.


function drush_get_runner($source, $destination, $runner = FALSE) {
  if (is_string($source)) {
    $source = drush_sitealias_get_record($site);
  if (is_string($destination)) {
    $destination = drush_sitealias_get_record($destination);

  // If both sites are remote, and --runner=auto, then we'll use the destination site.
  if (drush_sitealias_is_remote_site($source) && drush_sitealias_is_remote_site($destination)) {
    if ($runner == 'auto') {
      $runner = 'destination';

  // If the user explicitly requests a remote site, then return the selected one.
  if ($runner == 'destination') {
    return "@" . $destination['#name'];
  if ($runner == 'source') {
    return "@" . $source['#name'];

  // Default to running rsync locally. When in doubt, local is best, because
  // we can always resolve aliases here.
  return '@self';