Skip to content

Commit 07eae80

Browse files
author
Paul Philion
committed
first pass of working backup. only captures data, not users
1 parent 427b492 commit 07eae80

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

scripts/backup-kube.sh

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,24 @@
11
#!/usr/bin/env bash
22

3-
# Backup the resilience DB
4-
53
# load the env...
6-
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
7-
. $SCRIPT_DIR/../.env
4+
#SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
5+
#. $SCRIPT_DIR/../.env
6+
7+
# Backup the resilience DB
8+
# FIXME - Load somehow, this is from the sample
9+
PGPASSWORD=example123456
810

911
pod_name=$(kubectl get pods | grep supabase-supabase-db | cut -f1 -d' ')
1012
backup_file="resilience-backup-`date +%Y-%m-%d`.sql"
11-
user=supabase_admin
13+
14+
# NOTE: user from values.cloud.yml
15+
db_name=postgres
16+
export PGUSER=postgres
17+
1218

1319
echo Backing up $pod_name into $backup_file ...
14-
kubectl exec -it $pod_name -- bash -c "PGPASSWORD=$DB_PASSWORD pg_dump --schema=public -U $user $DB_NAME" > $backup_file
20+
kubectl exec -it $pod_name -- bash -c "PGPASSWORD=$DB_PASSWORD pg_dump --schema=public -U $user $db_name" > $backup_file
21+
#kubectl exec -it $pod_name -- bash -c "PGPASSWORD=$DB_PASSWORD pg_dumpall -U $user" > $backup_file
22+
#kubectl exec -it $pod_name -- bash -c "PGPASSWORD=$PGPASSWORD PGUSER=$PGUSER pg_dumpall"
23+
1524
echo done.

0 commit comments

Comments
 (0)