I like to know if it is possible to extend drush aliases with more specific path variables. Is there anybody who can tell me how to extend the drush example code, that follows below with array for the file system paths for

  • temporary files directory
  • files directory
  • private files directory

So that I don't have to change them manually after every db sync when the dev server has other path settings then the productive server

This may be a silly question but I just looked at the documentation on github and haven't found any details.

  • The name of a variable is the same as the html 'name' attribute of the element used to input its value. Inspecting the HTML for the relevant admin pages will give you everything you need – Clive May 9 '15 at 10:29
  • so it seems i have missunderstood the concept and will rewrite my question – Josh May 9 '15 at 11:46
  • 1
    Is there any reason you need to Drush in particular? Usually one would use an environment-specific settings.php file to override config vars for just that site, e.g. $conf['file_temporary_path'] = '/path/to/tmp';. Config Variables declared in settings.php will always override those in the database – Clive May 9 '15 at 12:05
  • maybe good to know: by default settings.php is not sync with "drush rsync". So you can define your custom variable there as suggested by Clive. see "drush help rsync" – xaa Jun 7 '15 at 16:28

The Drush rsync and drupal-directory (dd) commands already supports the functionality you desire, without the need for you to extend your alias files. For example, to copy your files directory:

drush rsync @live:%files @dev:%files

To copy a specific folder from your temporary directory:

drush rsync @dev:%temp/foo @live:%temp

To change your working directory to the location where the devel modulr is installed:

cd $(drush dd @dev:%devel)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.