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