introduce list-snapshot
This commit is contained in:
parent
bc2f444b75
commit
1757fcebb9
3 changed files with 32 additions and 15 deletions
|
@ -6,5 +6,6 @@ install -m 0700 /tmp/entrypoint-start-and-wait.sh /
|
||||||
install -m 0700 /tmp/init.sh /usr/local/bin/
|
install -m 0700 /tmp/init.sh /usr/local/bin/
|
||||||
install -m 0700 /tmp/backup.sh /usr/local/bin/
|
install -m 0700 /tmp/backup.sh /usr/local/bin/
|
||||||
install -m 0700 /tmp/restore.sh /usr/local/bin/
|
install -m 0700 /tmp/restore.sh /usr/local/bin/
|
||||||
|
install -m 0700 /tmp/list-snapshots.sh /usr/local/bin/
|
||||||
install -m 0700 /tmp/start-maintenance.sh /usr/local/bin/
|
install -m 0700 /tmp/start-maintenance.sh /usr/local/bin/
|
||||||
install -m 0700 /tmp/end-maintenance.sh /usr/local/bin/
|
install -m 0700 /tmp/end-maintenance.sh /usr/local/bin/
|
||||||
|
|
31
infrastructure/docker-backup/image/resources/list-snapshots.sh
Executable file
31
infrastructure/docker-backup/image/resources/list-snapshots.sh
Executable file
|
@ -0,0 +1,31 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -o pipefail
|
||||||
|
|
||||||
|
function list-snapshot-files() {
|
||||||
|
if [ -z ${CERTIFICATE_FILE} ];
|
||||||
|
then
|
||||||
|
restic -r ${RESTIC_REPOSITORY}/${backup_file_path} snapshots
|
||||||
|
else
|
||||||
|
restic -r ${RESTIC_REPOSITORY}/${backup_file_path} snapshots --cacert ${CERTIFICATE_FILE}
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
list-snapshot-roles
|
||||||
|
list-snapshot-db
|
||||||
|
list-snapshot-files
|
||||||
|
}
|
||||||
|
|
||||||
|
source /usr/local/lib/functions.sh
|
||||||
|
source /usr/local/lib/file-functions.sh
|
||||||
|
source /usr/local/lib/pg-functions.sh
|
||||||
|
|
||||||
|
main
|
|
@ -1,15 +0,0 @@
|
||||||
#!/bin/bash
|
|
||||||
|
|
||||||
set -o pipefail
|
|
||||||
|
|
||||||
function main() {
|
|
||||||
file_env AWS_ACCESS_KEY_ID
|
|
||||||
file_env AWS_SECRET_ACCESS_KEY
|
|
||||||
|
|
||||||
restic -r ${RESTIC_REPOSITORY}/files snapshots
|
|
||||||
}
|
|
||||||
|
|
||||||
source /usr/local/lib/functions.sh
|
|
||||||
source /usr/local/lib/file-functions.sh
|
|
||||||
|
|
||||||
main
|
|
Loading…
Reference in a new issue