<h2id="credentials">Credentials</h2><p>The <code>rsync</code> deploy method supports both username and password parameter
though it's recommended to use <code>.ssh/config</code> and an SSH agent to secure
the deployment. The <code>--password</code> parameter is not supported! Instead you
need to use <code>--key-file</code> (<code>LEKTOR_DEPLOY_KEY_FILE</code>) or <code>--key</code>
(<code>LEKTOR_DEPLOY_KEY</code>). The <code>--key-file</code> is the path to an OpenSSH private
key.</p>
<p>If you are using <code>--key</code> you can directly copy paste the contents of a key
into a string. This is useful if you want to use it as an environment
variable. The format for the string is <code>KEY_TYPE:BASE64</code> where <code>KEY_TYPE</code>
is the type of the key (<code>RSA</code>, <code>EC</code>, etc.) and <code>BASE64</code> is the base64 encoded
private key without newlines or whitespace. To find out which type your
key is look at the first line of the key marker. For instance <code>BEGIN EC
PRIVATE KEY</code> indicates an <code>EC</code> key. If no key type is defined <code>RSA</code> is
assumed.</p>
<h2id="deletion-support">Deletion Support</h2><divclass="admonition admonition-info"><p>New in version 3.2.</p></div><p>To keep two directories truly in sync when deploying with <code>rsync</code>,
it's necessary to explicitly tell <code>rsync</code> to remove files or directories
on target that don't exist on source anymore. This can be done using the
<p>If the parameter is provided Lektor will issue a <code>rsync --delete-delay</code>,
which performs deletions after all other transfers ended, and only in case
there were no failures.</p>
<divclass="admonition admonition-warning"><p>Note that the <code>?delete</code> option will remove <strong>any file or directory</strong>
on target that does not exist on source. This means that if you have files
in the target tree that are not managed by lektor, they will get removed.</p></div><h2id="exclusion-support">Exclusion Support</h2><p>You can exclude items from being synced by using one or more <code>exclude</code>
parameters. This is also useful in combination with <code>delete</code> to prevent
removal of files in the target tree that are not managed by lektor:</p>
Please enable JavaScript to view the <ahref="https://disqus.com/?ref_noscript"
rel="nofollow">comments powered by Disqus.</a>
</noscript>
</div>
</div>
</div>
</div>
</div>
<divclass="bottomsummary">
<divclass="container">
</div>
</div>
<footer>
<divclass="container">
<divclass="row">
<divclass="col-sm-4 icon-bar">
<ahref="https://github.com/lektor/lektor/"title="Lektor on GitHub"
><iclass="fa fa-github"></i></a>
<ahref="https://github.com/lektor/lektor/issues/"title="Report Issues for Lektor"
><iclass="fa fa-bug"></i></a>
<ahref="https://twitter.com/getlektor"title="Find Lektor on Twitter"
><iclass="fa fa-twitter"></i></a>
<ahref="https://gitter.im/lektor/lektor"title="Chat on Gitter"
><iclass="fa fa-comment"></i></a>
<ahref="https://github.com/lektor/lektor-website/tree/master/content/docs/deployment/rsync/contents.lr"title="View source for this page"><iclass="fa fa-code"></i></a>