Last active
July 5, 2018 12:32
-
-
Save taylor224/3df161dd007af9a223fa6eaf2c4f3bdb to your computer and use it in GitHub Desktop.
MariaDB Auto Backup Script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
NOW="$(date +%Y%m%d%H%M%S)" | |
FILENAME="${NOW}" | |
echo "[INFO] Backup Started" | |
echo "[INFO] Filename : dbname_${FILENAME}.db" | |
BACKUPCOMMAND="mysqldump -u root -p --quick --single-transaction --lock-tables=false dbname > dbname_${FILENAME}.db" | |
eval $BACKUPCOMMAND | |
echo "[INFO] Backup Finish!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment