passwordless backups for all

This commit is contained in:
Gitouche 2023-12-09 23:09:13 +01:00
parent b80c5f23d9
commit 5b57e48156
4 changed files with 56 additions and 0 deletions

13
podman-framadate/60_db_dump.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_not_root
ensure_scriptdir_equals_user
# pod should exist
ensure_pod_exists "${pod_name}"
podman exec framadate-db /bin/bash -c '/usr/bin/mysqldump -uroot --password=${MYSQL_ROOT_PASSWORD} --all-databases'

15
podman-gitea/60_db_dump.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_not_root
ensure_scriptdir_equals_user
# pod should exist
ensure_pod_exists "${pod_name}"
db=${1}
podman exec gitea-db /bin/bash -c "PGPASSWORD=\${POSTGRES_PASSWORD} pg_dump -w -F t -U \${POSTGRES_USER} ${db}"

15
podman-matrix/60_db_dump.sh Executable file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_not_root
ensure_scriptdir_equals_user
# pod should exist
ensure_pod_exists "${pod_name}"
db=${1}
podman exec synapse-db /bin/bash -c "PGPASSWORD=\${POSTGRES_PASSWORD} pg_dump -w -F t -U \${POSTGRES_USER} ${db}"

13
podman-seafile/60_db_dump.sh Executable file
View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_not_root
ensure_scriptdir_equals_user
# pod should exist
ensure_pod_exists "${pod_name}"
podman exec seafile-db /bin/bash -c '/usr/bin/mysqldump -uroot --password=${MYSQL_ROOT_PASSWORD} --all-databases'