Skip to content
Snippets Groups Projects
Commit 77c7c7f4 authored by Pierre Ozoux's avatar Pierre Ozoux
Browse files

Update kubedb.md

parent ec2cde9b
No related branches found
No related tags found
No related merge requests found
...@@ -7,5 +7,5 @@ kubectl get snapshots.kubedb.com -o go-template --template '{{range .items}}{{.m ...@@ -7,5 +7,5 @@ kubectl get snapshots.kubedb.com -o go-template --template '{{range .items}}{{.m
Clean snapshots older than 2 months in all namespaces: Clean snapshots older than 2 months in all namespaces:
``` ```
kubectl get snapshots.kubedb.com -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' -A | awk '$3 <= "'$(date -d '2 month ago' -Ins --utc | sed 's/+0000/Z/')'" { print $1 " " $2}' | xargs --no-run-if-empty kubectl delete snapshots.kubedb.com kubectl get snapshots.kubedb.com -o go-template --template '{{range .items}}{{.metadata.namespace}} {{.metadata.name}} {{.metadata.creationTimestamp}}{{"\n"}}{{end}}' -A | awk '$3 <= "'$(date -d '2 month ago' -Ins --utc | sed 's/+0000/Z/')'" { print $1 " " $2}' | xargs --no-run-if-empty kubectl delete snapshots.kubedb.com -n
``` ```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment