Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
s10 committed Jan 27, 2025
1 parent 6221c8a commit 39c76d0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions common/pxc-db/templates/bin/_backup.sh.tpl
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/bash

date=$(date -u +"%Y-%m-%dT%H:%M:%SZ")

mkdir -p /tmp/${date}

mysqldump \
--port="${PXC_NODE_PORT}" \
--host="${PXC_NODE_NAME}" \
Expand All @@ -8,6 +12,12 @@ mysqldump \
--single-transaction \
--quick \
--all-databases \
--source-data=1 > /tmp/dump.sql
--source-data=1 > /tmp/${date}/dump.sql

xbstream -C /tmp -c ${date} $XBSTREAM_EXTRA_ARGS \
| xbcloud put --parallel="$(grep -c processor /proc/cpuinfo)" --storage=s3 --md5 --s3-bucket="$S3_BUCKET" "$S3_BUCKET_PATH" 2>&1 \
| (grep -v "error: http request failed: Couldn't resolve host name" || exit 1)

rm -fr /tmp/${date}

sleep 3600
sleep 600
2 changes: 1 addition & 1 deletion common/pxc-db/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ backup:
schedule: "15 0 * * *"
s3:
config:
bucket: "pxc-backup-{{ .Values.global.region }}"
bucket: "pxc-logical-{{ .Values.global.region }}"
prefix: "{{ .Values.name }}/"

# -- Default Prometheus alerts and rules.
Expand Down

0 comments on commit 39c76d0

Please sign in to comment.