wpamapsta : db dump script
This commit is contained in:
parent
4221ba56ab
commit
b80c5f23d9
|
@ -37,6 +37,13 @@ ensure_pwd_is_scriptdir () {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ok if current user is the same (name) as script directory
|
||||||
|
ensure_scriptdir_equals_user () {
|
||||||
|
if [[ "$USER" != "${ABSDIR##*/}" ]]; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
# make sure systemd directory exists
|
# make sure systemd directory exists
|
||||||
ensure_systemd_as_user_dir_exists () {
|
ensure_systemd_as_user_dir_exists () {
|
||||||
[[ -d ${HOME}/.config/systemd/user/ ]] || mkdir -p ${HOME}/.config/systemd/user/
|
[[ -d ${HOME}/.config/systemd/user/ ]] || mkdir -p ${HOME}/.config/systemd/user/
|
||||||
|
|
13
podman-wpamapsta/60_db_dump.sh
Executable file
13
podman-wpamapsta/60_db_dump.sh
Executable 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 db /bin/bash -c '/usr/bin/mysqldump --user=${MARIADB_USER} --password=${MARIADB_PASSWORD} --all-databases'
|
Loading…
Reference in a new issue