17 lines
442 B
Bash
17 lines
442 B
Bash
#!/bin/bash
|
|
|
|
# Take the current datetime:
|
|
DT=`date +%Y-%m-%d`
|
|
# Set the environment:
|
|
set -o allexport
|
|
source ../.env
|
|
set +o allexport
|
|
# Take the current datetime:
|
|
DT=`date +%Y-%m-%d`
|
|
# Create the backup:
|
|
docker exec cockroach \
|
|
cockroach sql \
|
|
--host cockroach:26257 \
|
|
--certs-dir=/certs \
|
|
--execute="BACKUP TO 's3://skynet-crdb-backups/backups/$DT?AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID&AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY';"
|