Drush: examples/example.aliases.drushrc.php File Reference

  1. 7.x doxygen/html/example_8aliases_8drushrc_8php.html
  2. master doxygen/html/example_8aliases_8drushrc_8php.html

Go to the source code of this file.

Detailed Description

Example of valid statements for an alias file.

Use this file as a guide to creating your own aliases.

Aliases are commonly used to define short names for local or remote Drupal installations; however, an alias is really nothing more than a collection of options. A canonical alias named "dev" that points to a local Drupal site named "dev.mydrupalsite.com" looks like this:

$aliases['dev'] = array(
'root' => '/path/to/drupal',
'uri' => 'dev.mydrupalsite.com',
);

With this alias definition, then the following commands are equivalent:

$ drush status $ drush –root=/path/to/drupal –uri=dev.mydrupalsite.com status

See the –uri option documentation below for hints on setting its value.

Any option that can be placed on the drush commandline can also appear in an alias definition.

There are several ways to create alias files.

  • Put each alias in a separate file called ALIASNAME.alias.drushrc.php
  • Put multiple aliases in a single file called aliases.drushrc.php
  • Put groups of aliases into files called GROUPNAME.aliases.drushrc.php

Drush will search for aliases in any of these files using the alias search path. The following locations are examined for alias files:

  1. In any path set in $options['alias-path'] in drushrc.php, or (equivalently) any path passed in via –alias-path=... on the command line.
  2. In one of the default locations: a. /etc/drush b. $HOME/.drush c. The /drush and /sites/all/drush folders for the current Drupal site
  3. Inside the sites folder of any bootstrapped Drupal site, or any local Drupal site indicated by an alias used as a parameter to a command

Folders and files containing other versions of drush in their names will be skipped (e.g. mysite.aliases.drush4rc.php or drush4/mysite.aliases.drushrc.php). Names containing the current version of Drush (e.g. mysite.aliases.drush5rc.php) will be loaded.

Files stored in these locations can be used to create aliases to local and remote Drupal installations. These aliases can be used in place of a site specification on the command line, and may also be used in arguments to certain commands such as "drush rsync" and "drush sql-sync".

Alias files that are named after the single alias they contain may use the syntax for the canonical alias shown at the top of this file, or they may set values in $options, just like a drushrc.php configuration file:

$options['uri'] = 'dev.mydrupalsite.com',
$options['root'] = '/path/to/drupal';

When alias files use this form, then the name of the alias is taken from the first part of the alias filename.

Alias groups (aliases stored together in files called GROUPNAME.aliases.drushrc.php, as mentioned above) also create an implicit namespace that is named after the group name.

For example:

# File: mysite.aliases.drushrc.php
$aliases['dev'] = array(
'root' => '/path/to/drupal',
'uri' => 'dev.mydrupalsite.com',
);
$aliases['live'] = array(
'root' => '/other/path/to/drupal',
'uri' => 'mydrupalsite.com',
);

Then the following special aliases are defined:

  • : An alias named after the groupname may be used to reference all of the aliases in the group (e.g., drush @mydrupalsite status).
  • .dev: A copy of .
  • .live: A copy of .

Thus, aliases defined in an alias group file may be referred to either by their simple (short) name, or by their full namespace-qualified name.

To see an example alias definition for the current bootstrapped site, use the "site-alias" command with the built-in alias "@self":

$ drush site-alias

TIP: If you would like to have drush include a 'databases' record in the output, include the options –with-db and –show-passwords:

$ drush site-alias –with-db –show-passwords

Drush also supports remote site aliases. When a site alias is defined for a remote site, Drush will use the ssh command to run the requested command on the remote machine. The simplest remote alias looks like this:

$aliases['live'] = array(
'remote-host' => 'server.domain.com',
'remote-user' => 'www-admin',
);

The form above requires that Drush be installed on the remote machine, and that there also be an alias of the same name defined on that machine. The remote alias should define the 'root' and 'uri' elements, as shown in the initial example at the top of this file.

If you do not wish to maintain site aliases on the remote machine, then you may define an alias that contains all of the elements 'remote-host', 'remote-user', 'root' and 'uri'. If you do this, then Drush will make the remote call using the –root and –uri options to identify the site, so no site alias is required on the remote server.

$aliases['live'] = array(
'remote-host' => 'server.domain.com',
'remote-user' => 'www-admin',
'root' => '/other/path/to/drupal',
'uri' => 'mydrupalsite.com',
);

If you would like to see all of the Drupal sites at a specified root directory, use the built-in alias "@sites":

$ drush -r /path/to/drupal site-alias

It is also possible to define explicit lists of sites using a special alias list definition. Alias lists contain a list of alias names in the group, and no other information. For example:

$aliases['mydevsites'] = array(
'site-list' => array('@mysite.dev', '@otherside.dev');
);

The built-in alias "@none" represents the state of no Drupal site; to ignore the site at the cwd and just see default drush status:

$ drush status

See drush help site-alias for more options for displaying site aliases. See drush topic docs-bastion for instructions on configuring remote access to a Drupal site behind a firewall via a bastion server.

Although most aliases will contain only a few options, a number of settings that are commonly used appear below:

  • 'uri': In Drupal 7, the value of –uri should always be the same as when the site is being accessed from a web browser (e.g. http://mysite.org, although the http:// is optional). In Drupal 6, the value of –uri should always be the same as the site's folder name in the 'sites' folder (e.g. default); it is best if the site folder name matches the URI from the browser, and is consistent on every instance of the same site (e.g. also use sites/mysite.org for http://dev.mysite.org).
  • 'root': The Drupal root; must not be specified as a relative path.
  • 'remote-port': If the database is remote and 'db-url' contains a tunneled port number, put the actual database port number used on the remote machine in the 'remote-port' setting.
  • 'remote-host': The fully-qualified domain name of the remote system hosting the Drupal instance. **Important Note: The remote-host option must be omitted for local sites, as this option controls whether or not rsync parameters are for local or remote machines.
  • '#check-local': Test to see if 'remote-host' is the local machine; if it is, then 'remote-host' will be ignore. Useful when sharing aliases among multiple machines.
  • 'remote-user': The username to log in as when using ssh or rsync.
  • 'os': The operating system of the remote server. Valid values are 'Windows' and 'Linux'. Be sure to set this value for all remote aliases because the default value is PHP_OS if 'remote-host' is not set, and 'Linux' (or $options['remote-os']) if it is. Therefore, if you set a 'remote-host' value, and your remote OS is Windows, if you do not set the 'OS' value, it will default to 'Linux' and could cause unintended consequences, particularly when running 'drush sql-sync'.
  • 'ssh-options': If the target requires special options, such as a non- standard port, alternative identity file, or alternative authentication method, ssh-options can contain a string of extra options that are used with the ssh command, eg "-p 100"
  • 'parent': The name of a parent alias (e.g. '') to use as a basis for this alias. Any value of the parent will appear in the child unless overridden by an item with the same name in the child. Multiple inheritance is possible; name multiple parents in the 'parent' item separated by commas (e.g. ',').
  • 'db-url': The Drupal 6 database connection string from settings.php. For remote databases accessed via an ssh tunnel, set the port number to the tunneled port as it is accessed on the local machine. If 'db-url' is not provided, then drush will automatically look it up, either from settings.php on the local machine, or via backend invoke if the target alias specifies a remote server.
  • 'databases': Like 'db-url', but contains the full Drupal 7 databases record. Drush will look up the 'databases' record if it is not specified.
  • 'path-aliases': An array of aliases for common rsync targets. Relative aliases are always taken from the Drupal root.
    • 'drush-script': The path to the 'drush' script, or to 'drush.php' or 'drush.bat', as desired. This is used by backend invoke when drush runs a drush command. The default is 'drush' on remote machines, or the full path to drush.php on the local machine.
    • 'drush': A read-only property: points to the folder that the drush script is stored in.
    • 'dump-dir': Path to directory that "drush sql-sync" should use to store sql-dump files. Helpful filenames are auto-generated.
    • 'dump': Path to the file that "drush sql-sync" should use to store sql-dump file.
    • 'files': Path to 'files' directory. This will be looked up if not specified.
    • 'root': A reference to the Drupal root defined in the 'root' item in the site alias record.
  • 'php': path to custom php interpreter. Windows support limited to Cygwin.
  • 'php-options': commandline options for php interpreter, you may want to set this to '-d error_reporting="E_ALL^E_DEPRECATED"'
  • 'variables' : An array of name/value pairs which override Drupal variables/config. These values take precedence even over settings.php overrides.
  • 'command-specific': These options will only be set if the alias is used with the specified command. In the example below, the option --no-cache will be selected whenever the alias is used in any of the following ways:
    • drush @stage sql-sync @self @live
    • drush sql-sync @stage @live
    • drush sql-sync @live @stage In case of conflicting options, command-specific options in targets (source and destination) take precedence over command-specific options in the bootstrapped site, and command-specific options in a destination alias will take precedence over those in a source alias.
  • 'source-command-specific' and 'target-command-specific': Behaves exactly like the 'command-specific' option, but is applied only if the alias is used as the source or target, respectively, of an rsync or sql-sync command. In the example below, --skip-tables-list=comments whenever the alias is the target of an sql-sync command, but comments will be included if is the source for the sql-sync command.
  • '#peer': Settings that begin with a '#' are not used directly by Drush, and in fact are removed before making a backend invoke call (for example). These kinds of values are useful in conjunction with shell aliases. See drush topic docs-shell-aliases for more information on this.
  • rsync command options have specific requirements in order to be passed through by Drush. See the comments on the sample below:
'command-specific' => array (
'core-rsync' => array (
// single-letter rsync options are placed in the 'mode' key
// instead of adding '--mode=rultvz' to drush rsync command.
'mode' => 'rultvz',
// multi-letter rsync options without values must be set to
// TRUE or NULL to work (i.e. setting $VALUE to 1, 0, or ''
// will not work).
'delete' => TRUE,
// wrapping an option's value in "" preserves inner '' on output;
// but is not always required.
'exclude' => "'*.gz'",
// cannot add multiple options of same key; each key overwrites
// the previous key's value. This 'exclude' option will overwrite
// the previous one above.
'exclude' => '*.sql',
// if you need multiple exludes, use an rsync exclude file
'exclude-from' => "'/etc/rsync/exclude.rules'",
// filter options with white space must be wrapped in "" to preserve
// the inner ''.
'filter' => "'exclude *.sql'",
// if you need multple filter options, see rsync merge-file options
'filter' => "'merge /etc/rsync/default.rules'",
),
),

Some examples appear below. Remove the leading hash signs to enable.

Definition in file example.aliases.drushrc.php.

File

doxygen/html/example_8aliases_8drushrc_8php.html
View source
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Drush: examples/example.aliases.drushrc.php File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">Drush
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.2 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d28a4824dc47e487b107a5db32ef43c4.html">examples</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">example.aliases.drushrc.php File Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><a href="example_8aliases_8drushrc_8php_source.html">Go to the source code of this file.</a></p>
<a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Example of valid statements for an alias file.</p>
<p>Use this file as a guide to creating your own aliases.</p>
<p>Aliases are commonly used to define short names for local or remote Drupal installations; however, an alias is really nothing more than a collection of options. A canonical alias named "dev" that points to a local Drupal site named "dev.mydrupalsite.com" looks like this:</p>
<div class="fragment"><div class="line">$aliases[<span class="stringliteral">&#39;dev&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;/path/to/drupal&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;uri&#39;</span> =&gt; <span class="stringliteral">&#39;dev.mydrupalsite.com&#39;</span>,</div>
<div class="line">);</div>
</div><!-- fragment --><p>With this alias definition, then the following commands are equivalent:</p>
<p>$ drush  status $ drush &ndash;root=/path/to/drupal &ndash;uri=dev.mydrupalsite.com status</p>
<p>See the &ndash;uri option documentation below for hints on setting its value.</p>
<p>Any option that can be placed on the drush commandline can also appear in an alias definition.</p>
<p>There are several ways to create alias files.</p>
<ul>
<li>Put each alias in a separate file called ALIASNAME.alias.drushrc.php</li>
<li>Put multiple aliases in a single file called aliases.drushrc.php</li>
<li>Put groups of aliases into files called GROUPNAME.aliases.drushrc.php</li>
</ul>
<p>Drush will search for aliases in any of these files using the alias search path. The following locations are examined for alias files:</p>
<ol type="1">
<li>In any path set in $options['alias-path'] in drushrc.php, or (equivalently) any path passed in via &ndash;alias-path=... on the command line.</li>
<li>In one of the default locations: a. /etc/drush b. $HOME/.drush c. The /drush and /sites/all/drush folders for the current Drupal site</li>
<li>Inside the sites folder of any bootstrapped Drupal site, or any local Drupal site indicated by an alias used as a parameter to a command</li>
</ol>
<p>Folders and files containing other versions of drush in their names will be <em>skipped</em> (e.g. mysite.aliases.drush4rc.php or drush4/mysite.aliases.drushrc.php). Names containing the current version of Drush (e.g. mysite.aliases.drush5rc.php) will be loaded.</p>
<p>Files stored in these locations can be used to create aliases to local and remote Drupal installations. These aliases can be used in place of a site specification on the command line, and may also be used in arguments to certain commands such as "drush rsync" and "drush sql-sync".</p>
<p>Alias files that are named after the single alias they contain may use the syntax for the canonical alias shown at the top of this file, or they may set values in $options, just like a drushrc.php configuration file:</p>
<div class="fragment"><div class="line">$options[<span class="stringliteral">&#39;uri&#39;</span>] = <span class="stringliteral">&#39;dev.mydrupalsite.com&#39;</span>,</div>
<div class="line">$options[<span class="stringliteral">&#39;root&#39;</span>] = <span class="stringliteral">&#39;/path/to/drupal&#39;</span>;</div>
</div><!-- fragment --><p>When alias files use this form, then the name of the alias is taken from the first part of the alias filename.</p>
<p>Alias groups (aliases stored together in files called GROUPNAME.aliases.drushrc.php, as mentioned above) also create an implicit namespace that is named after the group name.</p>
<p>For example:</p>
<div class="fragment"><div class="line"><span class="preprocessor"># File: mysite.aliases.drushrc.php</span></div>
<div class="line"><span class="preprocessor"></span>$aliases[<span class="stringliteral">&#39;dev&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;/path/to/drupal&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;uri&#39;</span> =&gt; <span class="stringliteral">&#39;dev.mydrupalsite.com&#39;</span>,</div>
<div class="line">);</div>
<div class="line">$aliases[<span class="stringliteral">&#39;live&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;/other/path/to/drupal&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;uri&#39;</span> =&gt; <span class="stringliteral">&#39;mydrupalsite.com&#39;</span>,</div>
<div class="line">);</div>
</div><!-- fragment --><p>Then the following special aliases are defined:</p>
<ul>
<li>: An alias named after the groupname may be used to reference all of the aliases in the group (e.g., <code>drush @mydrupalsite status</code>).</li>
<li>.dev: A copy of .</li>
<li>.live: A copy of .</li>
</ul>
<p>Thus, aliases defined in an alias group file may be referred to either by their simple (short) name, or by their full namespace-qualified name.</p>
<p>To see an example alias definition for the current bootstrapped site, use the "site-alias" command with the built-in alias "@self":</p>
<p>$ drush site-alias </p>
<p>TIP: If you would like to have drush include a 'databases' record in the output, include the options &ndash;with-db and &ndash;show-passwords:</p>
<p>$ drush site-alias  &ndash;with-db &ndash;show-passwords</p>
<p>Drush also supports <em>remote</em> site aliases. When a site alias is defined for a remote site, Drush will use the ssh command to run the requested command on the remote machine. The simplest remote alias looks like this:</p>
<div class="fragment"><div class="line">$aliases[<span class="stringliteral">&#39;live&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;remote-host&#39;</span> =&gt; <span class="stringliteral">&#39;server.domain.com&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;remote-user&#39;</span> =&gt; <span class="stringliteral">&#39;www-admin&#39;</span>,</div>
<div class="line">);</div>
</div><!-- fragment --><p>The form above requires that Drush be installed on the remote machine, and that there also be an alias of the same name defined on that machine. The remote alias should define the 'root' and 'uri' elements, as shown in the initial example at the top of this file.</p>
<p>If you do not wish to maintain site aliases on the remote machine, then you may define an alias that contains all of the elements 'remote-host', 'remote-user', 'root' and 'uri'. If you do this, then Drush will make the remote call using the &ndash;root and &ndash;uri options to identify the site, so no site alias is required on the remote server.</p>
<div class="fragment"><div class="line">$aliases[<span class="stringliteral">&#39;live&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;remote-host&#39;</span> =&gt; <span class="stringliteral">&#39;server.domain.com&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;remote-user&#39;</span> =&gt; <span class="stringliteral">&#39;www-admin&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;root&#39;</span> =&gt; <span class="stringliteral">&#39;/other/path/to/drupal&#39;</span>,</div>
<div class="line">  <span class="stringliteral">&#39;uri&#39;</span> =&gt; <span class="stringliteral">&#39;mydrupalsite.com&#39;</span>,</div>
<div class="line">);</div>
</div><!-- fragment --><p>If you would like to see all of the Drupal sites at a specified root directory, use the built-in alias "@sites":</p>
<p>$ drush -r /path/to/drupal site-alias </p>
<p>It is also possible to define explicit lists of sites using a special alias list definition. Alias lists contain a list of alias names in the group, and no other information. For example:</p>
<div class="fragment"><div class="line">$aliases[<span class="stringliteral">&#39;mydevsites&#39;</span>] = array(</div>
<div class="line">  <span class="stringliteral">&#39;site-list&#39;</span> =&gt; array(<span class="stringliteral">&#39;@mysite.dev&#39;</span>, <span class="stringliteral">&#39;@otherside.dev&#39;</span>);</div>
<div class="line">);</div>
</div><!-- fragment --><p>The built-in alias "@none" represents the state of no Drupal site; to ignore the site at the cwd and just see default drush status:</p>
<p>$ drush  status</p>
<p>See <code>drush help site-alias</code> for more options for displaying site aliases. See <code>drush topic docs-bastion</code> for instructions on configuring remote access to a Drupal site behind a firewall via a bastion server.</p>
<p>Although most aliases will contain only a few options, a number of settings that are commonly used appear below:</p>
<ul>
<li>'uri': In Drupal 7, the value of &ndash;uri should always be the same as when the site is being accessed from a web browser (e.g. <a href="http://mysite.org,">http://mysite.org,</a> although the <a href="http://">http://</a> is optional). In Drupal 6, the value of &ndash;uri should always be the same as the site's folder name in the 'sites' folder (e.g. default); it is best if the site folder name matches the URI from the browser, and is consistent on every instance of the same site (e.g. also use sites/mysite.org for <a href="http://dev.mysite.org">http://dev.mysite.org</a>).</li>
<li>'root': The Drupal root; must not be specified as a relative path.</li>
<li>'remote-port': If the database is remote and 'db-url' contains a tunneled port number, put the actual database port number used on the remote machine in the 'remote-port' setting.</li>
<li>'remote-host': The fully-qualified domain name of the remote system hosting the Drupal instance. **Important Note: The remote-host option must be omitted for local sites, as this option controls whether or not rsync parameters are for local or remote machines.</li>
<li>'#check-local': Test to see if 'remote-host' is the local machine; if it is, then 'remote-host' will be ignore. Useful when sharing aliases among multiple machines.</li>
<li>'remote-user': The username to log in as when using ssh or rsync.</li>
<li>'os': The operating system of the remote server. Valid values are 'Windows' and 'Linux'. Be sure to set this value for all remote aliases because the default value is PHP_OS if 'remote-host' is not set, and 'Linux' (or $options['remote-os']) if it is. Therefore, if you set a 'remote-host' value, and your remote OS is Windows, if you do not set the 'OS' value, it will default to 'Linux' and could cause unintended consequences, particularly when running 'drush sql-sync'.</li>
<li>'ssh-options': If the target requires special options, such as a non- standard port, alternative identity file, or alternative authentication method, ssh-options can contain a string of extra options that are used with the ssh command, eg "-p 100"</li>
<li>'parent': The name of a parent alias (e.g. '') to use as a basis for this alias. Any value of the parent will appear in the child unless overridden by an item with the same name in the child. Multiple inheritance is possible; name multiple parents in the 'parent' item separated by commas (e.g. ',').</li>
<li>'db-url': The Drupal 6 database connection string from settings.php. For remote databases accessed via an ssh tunnel, set the port number to the tunneled port as it is accessed on the local machine. If 'db-url' is not provided, then drush will automatically look it up, either from settings.php on the local machine, or via backend invoke if the target alias specifies a remote server.</li>
<li>'databases': Like 'db-url', but contains the full Drupal 7 databases record. Drush will look up the 'databases' record if it is not specified.</li>
<li>'path-aliases': An array of aliases for common rsync targets. Relative aliases are always taken from the Drupal root.<ul>
<li>'drush-script': The path to the 'drush' script, or to '<a class="el" href="drush_8php.html">drush.php</a>' or 'drush.bat', as desired. This is used by backend invoke when drush runs a drush command. The default is 'drush' on remote machines, or the full path to <a class="el" href="drush_8php.html">drush.php</a> on the local machine.</li>
<li>'drush': A read-only property: points to the folder that the drush script is stored in.</li>
<li>'dump-dir': Path to directory that "drush sql-sync" should use to store sql-dump files. Helpful filenames are auto-generated.</li>
<li>'dump': Path to the file that "drush sql-sync" should use to store sql-dump file.</li>
<li>'files': Path to 'files' directory. This will be looked up if not specified.</li>
<li>'root': A reference to the Drupal root defined in the 'root' item in the site alias record.</li>
</ul>
</li>
<li>'php': path to custom php interpreter. Windows support limited to Cygwin.</li>
<li>'php-options': commandline options for php interpreter, you may want to set this to '-d error_reporting="E_ALL^E_DEPRECATED"'</li>
<li>'variables' : An array of name/value pairs which override Drupal variables/config. These values take precedence even over settings.php overrides.</li>
<li>'command-specific': These options will only be set if the alias is used with the specified command. In the example below, the option <code>--no-cache</code> will be selected whenever the  alias is used in any of the following ways:<ul>
<li><code>drush @stage sql-sync @self @live</code></li>
<li><code>drush sql-sync @stage @live</code></li>
<li><code>drush sql-sync @live @stage</code> In case of conflicting options, command-specific options in targets (source and destination) take precedence over command-specific options in the bootstrapped site, and command-specific options in a destination alias will take precedence over those in a source alias.</li>
</ul>
</li>
<li>'source-command-specific' and 'target-command-specific': Behaves exactly like the 'command-specific' option, but is applied only if the alias is used as the source or target, respectively, of an rsync or sql-sync command. In the example below, <code>--skip-tables-list=comments</code> whenever the alias  is the target of an sql-sync command, but comments will be included if  is the source for the sql-sync command.</li>
<li>'#peer': Settings that begin with a '#' are not used directly by Drush, and in fact are removed before making a backend invoke call (for example). These kinds of values are useful in conjunction with shell aliases. See <code>drush topic docs-shell-aliases</code> for more information on this.</li>
<li>rsync command options have specific requirements in order to be passed through by Drush. See the comments on the sample below:</li>
</ul>
<div class="fragment"><div class="line"><span class="stringliteral">&#39;command-specific&#39;</span> =&gt; array (</div>
<div class="line">  <span class="stringliteral">&#39;core-rsync&#39;</span> =&gt; array (</div>
<div class="line"></div>
<div class="line">    <span class="comment">// single-letter rsync options are placed in the &#39;mode&#39; key</span></div>
<div class="line">    <span class="comment">// instead of adding &#39;--mode=rultvz&#39; to drush rsync command.</span></div>
<div class="line">    <span class="stringliteral">&#39;mode&#39;</span> =&gt; <span class="stringliteral">&#39;rultvz&#39;</span>,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// multi-letter rsync options without values must be set to</span></div>
<div class="line">    <span class="comment">// TRUE or NULL to work (i.e. setting $VALUE to 1, 0, or &#39;&#39;</span></div>
<div class="line">    <span class="comment">// will not work).</span></div>
<div class="line">    <span class="stringliteral">&#39;delete&#39;</span> =&gt; TRUE,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// wrapping an option&#39;s value in &quot;&quot; preserves inner &#39;&#39; on output;</span></div>
<div class="line">    <span class="comment">// but is not always required.</span></div>
<div class="line">    <span class="stringliteral">&#39;exclude&#39;</span> =&gt; <span class="stringliteral">&quot;&#39;*.gz&#39;&quot;</span>,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// cannot add multiple options of same key; each key overwrites</span></div>
<div class="line">    <span class="comment">// the previous key&#39;s value. This &#39;exclude&#39; option will overwrite</span></div>
<div class="line">    <span class="comment">// the previous one above.</span></div>
<div class="line">    <span class="stringliteral">&#39;exclude&#39;</span> =&gt; <span class="stringliteral">&#39;*.sql&#39;</span>,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// if you need multiple exludes, use an rsync exclude file</span></div>
<div class="line">    <span class="stringliteral">&#39;exclude-from&#39;</span> =&gt; <span class="stringliteral">&quot;&#39;/etc/rsync/exclude.rules&#39;&quot;</span>,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// filter options with white space must be wrapped in &quot;&quot; to preserve</span></div>
<div class="line">    <span class="comment">// the inner &#39;&#39;.</span></div>
<div class="line">    <span class="stringliteral">&#39;filter&#39;</span> =&gt; <span class="stringliteral">&quot;&#39;exclude *.sql&#39;&quot;</span>,</div>
<div class="line"></div>
<div class="line">    <span class="comment">// if you need multple filter options, see rsync merge-file options</span></div>
<div class="line">    <span class="stringliteral">&#39;filter&#39;</span> =&gt; <span class="stringliteral">&quot;&#39;merge /etc/rsync/default.rules&#39;&quot;</span>,</div>
<div class="line">  ),</div>
<div class="line">),</div>
</div><!-- fragment --><p>Some examples appear below. Remove the leading hash signs to enable. </p>

<p>Definition in file <a class="el" href="example_8aliases_8drushrc_8php_source.html">example.aliases.drushrc.php</a>.</p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Oct 8 2014 09:04:59 for Drush by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.1.2
</small></address>
</body>
</html>