2021-09-04 14:27:05 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Downloads a database backup from DigitalOcean. Does not restore it on its own; we have the
|
|
|
|
# seedfile command for that.
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
source /home/hmn/hmn/server/hmn.conf
|
|
|
|
|
|
|
|
s3cmd --config /home/hmn/.s3cfg ls s3://hmn-backup/db/
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Above is a list of all the available database backups."
|
|
|
|
echo "Enter the name of the one you would like to download (e.g. \"hmn_pg_dump_live_2021-09-01\"):"
|
|
|
|
read filename
|
|
|
|
|
2021-09-06 00:43:49 +00:00
|
|
|
s3cmd --config /home/hmn/.s3cfg get --force s3://hmn-backup/db/$filename $filename
|
2021-09-04 14:27:05 +00:00
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Downloaded $filename to $(pwd)."
|