#!/bin/bash # MySQL Console Dumper # author: Nico Hemkes # date: 26.09.2016 # settings user="USER" pw="PASSWORD" backupDir="/media/backup/" today=$(date +"%m-%d-%Y") filename="mysql_dump-$today.sql.gz" # output start printf "\n= = = MySQL Console Dumper = = =" printf "\nstarting ...\n\n" # dump mysqldump -u"$user" -p"$pw" -Q --events --ignore-table=mysql.event --all-databases | gzip -9 > $backupDir$filename # output end printf "Backup placed at $backupDir$filename\n\n" printf "done!\n"