15 lines
363 B
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
|