summaryrefslogtreecommitdiff
path: root/byteback-mysql/scripts.d/Bytemyback/mysqldump-full
diff options
context:
space:
mode:
Diffstat (limited to 'byteback-mysql/scripts.d/Bytemyback/mysqldump-full')
-rwxr-xr-xbyteback-mysql/scripts.d/Bytemyback/mysqldump-full8
1 files changed, 8 insertions, 0 deletions
diff --git a/byteback-mysql/scripts.d/Bytemyback/mysqldump-full b/byteback-mysql/scripts.d/Bytemyback/mysqldump-full
new file mode 100755
index 0000000..b4bb01e
--- /dev/null
+++ b/byteback-mysql/scripts.d/Bytemyback/mysqldump-full
@@ -0,0 +1,8 @@
+#!/bin/bash
+
+if [ "$1" == "pre" ]; then
+ HOST=`hostname`
+ echo "Dumping all databases into one backup file"
+ mkdir -p /var/backups/byteback/mysqldump-full
+ mysqldump --defaults-file=/etc/mysql/debian.cnf -A --events | gzip > /var/backups/byteback/mysqldump-full/dump.sql.gz && mauvesend -i mysqldump-split-${HOST}-low -c now -r +30h -s "mysqldump on ${HOST} has not run for over a day" --detail='Please try running manually to see what the problem was, and check the mailing list'
+fi