$ oc get backup -o json
{
"apiVersion": "v1",
"items": [
{
"apiVersion": "velero.io/v1",
"kind": "Backup",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"velero.io/v1\",\"kind\":\"Backup\",\"metadata\":{\"annotations\":{},\"name\":\"mysql-bkp-1\",\"namespace\":\"rfelix-oadp\"},\"spec\":{\"includedNamespaces\":[\"rfelix-mysql\"],\"snapshotVolumes\":true,\"ttl\":\"720h0m0s\"}}\n",
"velero.io/source-cluster-k8s-gitversion": "v1.23.5+3afdacb",
"velero.io/source-cluster-k8s-major-version": "1",
"velero.io/source-cluster-k8s-minor-version": "23"
},
"creationTimestamp": "2022-08-30T20:32:29Z",
"generation": 5,
"labels": {
"velero.io/storage-location": "velero-netapp-1"
},
"name": "mysql-bkp-1",
"namespace": "rfelix-oadp",
"resourceVersion": "269544630",
"uid": "39c062e0-1f27-4a3e-9894-a4ed5a229181"
},
"spec": {
"defaultVolumesToRestic": false,
"includedNamespaces": [
"rfelix-mysql"
],
"snapshotVolumes": true,
"storageLocation": "velero-netapp-1",
"ttl": "720h0m0s",
"volumeSnapshotLocations": [
"velero-netapp-1"
]
},
"status": {
"completionTimestamp": "2022-08-30T20:33:08Z",
"expiration": "2022-09-29T20:32:29Z",
"formatVersion": "1.1.0",
"phase": "Completed",
"progress": {
"itemsBackedUp": 116,
"totalItems": 116
},
"startTimestamp": "2022-08-30T20:32:29Z",
"version": 1
}
},
{
"apiVersion": "velero.io/v1",
"kind": "Backup",
"metadata": {
"annotations": {
"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"velero.io/v1\",\"kind\":\"Backup\",\"metadata\":{\"annotations\":{},\"name\":\"mysql-bkp-2\",\"namespace\":\"rfelix-oadp\"},\"spec\":{\"includedNamespaces\":[\"rfelix-mysql\"],\"snapshotVolumes\":true,\"ttl\":\"3h0m0s\"}}\n",
"velero.io/source-cluster-k8s-gitversion": "v1.23.5+3afdacb",
"velero.io/source-cluster-k8s-major-version": "1",
"velero.io/source-cluster-k8s-minor-version": "23"
},
"creationTimestamp": "2022-08-31T12:02:43Z",
"generation": 5,
"labels": {
"velero.io/storage-location": "velero-netapp-1"
},
"name": "mysql-bkp-2",
"namespace": "rfelix-oadp",
"resourceVersion": "271447329",
"uid": "76ef3707-1e49-419f-ac24-5c2b1f53073f"
},
"spec": {
"defaultVolumesToRestic": false,
"includedNamespaces": [
"rfelix-mysql"
],
"snapshotVolumes": true,
"storageLocation": "velero-netapp-1",
"ttl": "3h0m0s",
"volumeSnapshotLocations": [
"velero-netapp-1"
]
},
"status": {
"completionTimestamp": "2022-08-31T12:03:22Z",
"expiration": "2022-08-31T15:02:43Z",
"formatVersion": "1.1.0",
"phase": "Completed",
"progress": {
"itemsBackedUp": 65,
"totalItems": 65
},
"startTimestamp": "2022-08-31T12:02:43Z",
"version": 1
}
}
],
"kind": "List",
"metadata": {
"resourceVersion": "",
"selfLink": ""
}
}
$ oc get backup -n ${OADP_NS} -o=jsonpath='{"name"}{"\t\t\t"}{"completionTimestamp"}{"\t"}{"expiration"}{"\t\t"}{"phase"}{"\t\t"}{"itemsBackedUp"}{"\t"}{"totalItems"}{"\t"}{"startTimestamp"}{"\n"}{range .items[*]}{.metadata.name}{"\t"}{.status.completionTimestamp}{"\t"}{.status.expiration}{"\t"}{.status.phase}{"\t"}{.status.progress.itemsBackedUp}{"\t\t"}{.status.progress.totalItems}{"\t\t"}{.status.startTimestamp}{"\n"}{end}'
name completionTimestamp expiration phase itemsBackedUp totalItems startTimestamp
mysql-bkp-1 2022-08-30T20:33:08Z 2022-09-29T20:32:29Z Completed 116 116 2022-08-30T20:32:29Z
mysql-bkp-2 2022-08-31T12:03:22Z 2022-08-31T15:02:43Z Completed 65 65 2022-08-31T12:02:43Z
$ cat <<EOF >template.tpl
{"name"}{"\t\t\t"}{"completionTimestamp"}{"\t"}{"expiration"}{"\t\t"}{"phase"}{"\t\t"}{"itemsBackedUp"}{"\t"}{"totalItems"}{"\t"}{"startTimestamp"}
{range .items[*]}
{.metadata.name}{"\t"}{.status.completionTimestamp}{"\t"}{.status.expiration}{"\t"}{.status.phase}{"\t"}{.status.progress.itemsBackedUp}{"\t\t"}{.status.progress.totalItems}{"\t\t"}{.status.startTimestamp}{end}
EOF
$ oc get backup -n ${OADP_NS} -o jsonpath-file=template.tpl
name completionTimestamp expiration phase itemsBackedUp totalItems startTimestamp
mysql-bkp-1 2022-08-30T20:33:08Z 2022-09-29T20:32:29Z Completed 116 116 2022-08-30T20:32:29Z
mysql-bkp-2 2022-08-31T12:03:22Z 2022-08-31T15:02:43Z Completed 65 65 2022-08-31T12:02:43Z