From 05f986658bc04e2dc514b2c3e7777007cb6fb65c Mon Sep 17 00:00:00 2001 From: Carlo Landmeter Date: Mon, 29 Jan 2018 15:31:27 +0000 Subject: Initial commit --- profiles/backup-mysql | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 profiles/backup-mysql (limited to 'profiles/backup-mysql') diff --git a/profiles/backup-mysql b/profiles/backup-mysql new file mode 100755 index 0000000..ff6edd6 --- /dev/null +++ b/profiles/backup-mysql @@ -0,0 +1,10 @@ +#!/bin/sh + +if [ -n "$MYSQL_PASSWORD" ]; then + echo "Dumping databases to: $BACKUP_CACHE/mysql.sql" + [ -d "$CACHE_DIR" ] || mkdir -p "$BACKUP_CACHE" + mysqldump -u root -p${MYSQL_PASSWORD} --all-databases -r \ + $BACKUP_CACHE/mysql.sql +else + echo "MySQL password not set, skipping mysqldump." +fi -- cgit v1.2.3