#!/bin/bash set -x NOW=$( date +%Y%m%d%H%M ) mkdir -p /BACKUPS/$NOW mysqldump \ --host=10.42.1.171 \ --user=nextcloud \ --all-databases \ --password=`grep dbpass /var/www/html/nextcloud/config/config.php |cut -f 4 -d "'"` | pbzip2 > /BACKUPS/$NOW/mysql-`hostname`-$NOW.sql.bz2