This repository has been archived on 2024-08-09. You can view files and clone it, but cannot push or open issues or pull requests.
joomla/bin/db-dump.bash

15 lines
363 B
Bash

#!/bin/bash
#check if root
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit;
fi
#Grab dotenv
export $(grep -v '^#' .env | xargs)
tstamp=`date +%Y%m%d`
docker-compose exec mariadb-joomla /usr/bin/mysqldump -u ${MYSQL_USER} --password=${MYSQL_PASSWORD} ${MYSQL_DATABASE} > sql/${JOOMLA_USER}-${MYSQL_DATABASE}-${tstamp}.sql