Use shared abra backup functions
This commit is contained in:
parent
4eaa4de5ae
commit
aae6b22d53
27
abra.sh
27
abra.sh
|
@ -16,34 +16,11 @@ sub_wp() {
|
|||
}
|
||||
|
||||
abra_backup_app() {
|
||||
# shellcheck disable=SC2034
|
||||
{
|
||||
abra__src_="app:/var/www/html/wp-content"
|
||||
abra__dst_="-"
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
FILENAME="$ABRA_DIR/backups/${abra__app_}_wp-content_$(date +%F).tar.gz"
|
||||
|
||||
sub_app_cp | gzip > "$FILENAME"
|
||||
|
||||
success "Backed up 'app' to $FILENAME"
|
||||
_abra_backup_dir "app:/var/www/html/wp-content"
|
||||
}
|
||||
|
||||
abra_backup_db() {
|
||||
# shellcheck disable=SC2034
|
||||
abra__service_="db"
|
||||
# 3wc: necessary because $abra__service_ won't be set if we're coming from
|
||||
# `abra_backup`, i.e. `abra app ... backup --all`
|
||||
|
||||
DB_ROOT_PASSWORD=$(sub_app_run cat /run/secrets/db_root_password)
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
FILENAME="$ABRA_DIR/backups/${abra__app_}_$(date +%F).sql.gz"
|
||||
|
||||
sub_app_run mysqldump -u root -p"$DB_ROOT_PASSWORD" wordpress | gzip > "$FILENAME"
|
||||
|
||||
success "Backed up 'db' to $FILENAME"
|
||||
_abra_backup_mysql "db" "wordpress"
|
||||
}
|
||||
|
||||
abra_backup() {
|
||||
|
|
Loading…
Reference in New Issue