c4k-taiga/infrastructure/backup/image/resources/restore.sh

30 lines
578 B
Bash
Raw Permalink Normal View History

#!/bin/bash
function main() {
file_env AWS_ACCESS_KEY_ID
file_env AWS_SECRET_ACCESS_KEY
file_env POSTGRES_DB
file_env POSTGRES_PASSWORD
file_env POSTGRES_USER
# Restore latest snapshot into /var/backups/restore
restore-directory '/var/backups/restore'
2023-10-24 12:40:34 +00:00
mv /var/backups/restore/* /media
2023-10-18 09:58:09 +00:00
# adjust file permissions for the taiga user
chown -R 999:999 /media
# Restore db
drop-create-db
restore-db
}
source /usr/local/lib/functions.sh
source /usr/local/lib/pg-functions.sh
source /usr/local/lib/file-functions.sh
main