From ae4d6bb0fcceaa4c895e6d0d7b1c21c2954e63d3 Mon Sep 17 00:00:00 2001 From: m-lib Date: Mon, 16 Mar 2020 20:20:45 -0300 Subject: [PATCH] document new rsync options related to https://github.com/lektor/lektor/pull/707 --- content/docs/deployment/rsync/contents.lr | 31 +++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/content/docs/deployment/rsync/contents.lr b/content/docs/deployment/rsync/contents.lr index c47997a0..e7060874 100644 --- a/content/docs/deployment/rsync/contents.lr +++ b/content/docs/deployment/rsync/contents.lr @@ -37,3 +37,34 @@ 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 `BEGIN EC PRIVATE KEY` indicates an `EC` key. If no key type is defined `RSA` is assumed. + +## Deletion Support + +To keep two directories truly in sync when deploying with `rsync`, +it's necessary to explicitly tell `rsync` to remove files or directories +on target that don't exist on source anymore. This can be done using the +`?delete` URL parameter: + +```ini +[servers.production] +target = rsync://server/path/to/folder?delete +``` + +If the parameter is provided Lektor will issue a `rsync --delete-delay`, +which performs deletions after all other transfers ended, and only in case +there were no failures. + +!!!! Note that the `?delete` option will remove **any file or directory** +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. + +## Exclusion Support + +You can exclude items from being synced by using one or more `exclude` +parameters. This is also useful in combination with `delete` to prevent +removal of files in the target tree that are not managed by lektor: + +```ini +[servers.production] +target = rsync://server/path/to/folder?delete&exclude=target_item_1&exclude=target_item_2 +```