This repository has been archived on 2022-10-07 . You can view files and clone it, but cannot push or open issues or pull requests.
2021-01-20 12:17:24 +00:00
#!/bin/bash
BACKUP = $1
if [ [ $BACKUP = = "" ] ] ; then
echo "No backup name given. It should look like '2020-01-29'."
exit 1
fi
2021-01-20 13:46:48 +00:00
# Set the environment:
set -o allexport
source ../.env
set +o allexport
# Restore the backup:
2021-01-20 12:17:24 +00:00
docker exec cockroach \
cockroach sql \
--host cockroach:26257 \
--certs-dir= /certs \
2021-01-20 13:46:48 +00:00
--execute= " RESTORE DATABASE defaultdb FROM 's3://skynet-crdb-backups/backups/ $DT ?AWS_ACCESS_KEY_ID= $AWS_ACCESS_KEY_ID &AWS_SECRET_ACCESS_KEY= $AWS_SECRET_ACCESS_KEY '; "