2023-10-18 09:05:16 +00:00
|
|
|
#!/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:05:16 +00:00
|
|
|
|
2023-10-18 09:58:09 +00:00
|
|
|
# adjust file permissions for the taiga user
|
2023-10-19 08:16:43 +00:00
|
|
|
chown -R 999:999 /media
|
2023-10-18 09:05:16 +00:00
|
|
|
|
|
|
|
# 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
|