aboutsummaryrefslogtreecommitdiffstats
path: root/profiles/backup-mysql
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@alpinelinux.org>2018-01-29 15:31:27 +0000
committerCarlo Landmeter <clandmeter@alpinelinux.org>2018-01-29 15:35:06 +0000
commit05f986658bc04e2dc514b2c3e7777007cb6fb65c (patch)
treedb49882a6aac4ea68b7fa6285c340c09466abcc5 /profiles/backup-mysql
downloadalpine-backup-05f986658bc04e2dc514b2c3e7777007cb6fb65c.tar.bz2
alpine-backup-05f986658bc04e2dc514b2c3e7777007cb6fb65c.tar.xz
Initial commit
Diffstat (limited to 'profiles/backup-mysql')
-rwxr-xr-xprofiles/backup-mysql10
1 files changed, 10 insertions, 0 deletions
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