From a8852c34e62d4c87104a72748c696f290bb6cc1e Mon Sep 17 00:00:00 2001 From: Nolan Brubaker Date: Mon, 30 Mar 2020 11:15:27 -0400 Subject: [PATCH] Document using multiple commands in hooks (#2365) Signed-off-by: Nolan Brubaker --- site/docs/master/hooks.md | 8 ++++++++ site/docs/v1.3.1/hooks.md | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/site/docs/master/hooks.md b/site/docs/master/hooks.md index 7ba0e50bc..81c14c967 100644 --- a/site/docs/master/hooks.md +++ b/site/docs/master/hooks.md @@ -75,6 +75,14 @@ velero backup get nginx-hook-test velero backup logs nginx-hook-test | grep hookCommand ``` +## Using Multiple Commands + +To use multiple commands, wrap your target command in a shell and separate them with `;`, `&&`, or other shell conditional constructs. + +```shell + pre.hook.backup.velero.io/command='["/bin/bash", "-c", "echo hello > hello.txt && echo goodbye > goodbye.txt"]' +``` + [1]: api-types/backup.md [2]: https://github.com/vmware-tanzu/velero/blob/master/examples/nginx-app/with-pv.yaml diff --git a/site/docs/v1.3.1/hooks.md b/site/docs/v1.3.1/hooks.md index 452395c9f..98e00f071 100644 --- a/site/docs/v1.3.1/hooks.md +++ b/site/docs/v1.3.1/hooks.md @@ -75,6 +75,14 @@ velero backup get nginx-hook-test velero backup logs nginx-hook-test | grep hookCommand ``` +## Using Multiple Commands + +To use multiple commands, wrap your target command in a shell and separate them with `;`, `&&`, or other shell conditional constructs. + +```shell + pre.hook.backup.velero.io/command='["/bin/bash", "-c", "echo hello > hello.txt && echo goodbye > goodbye.txt"]' +``` + [1]: api-types/backup.md [2]: https://github.com/vmware-tanzu/velero/blob/v1.3.1/examples/nginx-app/with-pv.yaml