Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 5

drush_tools_sync

Definition

drush_tools_sync($source = DRUSH_DRUPAL_ROOT, $destination)
contributions/drush/drush_tools/drush_tools.module, line 72

Description

Push the current Drupal install to another server via SSH and RSync

Return value

void

Code

<?php
function drush_tools_sync($source = DRUSH_DRUPAL_ROOT, $destination) {
  $options = '-az';
  if (DRUSH_VERBOSE) {
    drush_print(t('Executing: !cmd', array('!cmd' => $exec)));
    $options .= 'v';
  }
  $exec = "rsync -e ssh $options --exclude \"*.svn*\" $source $destination";

  return drush_op('system', $exec) !== FALSE;
}
?>