Created
December 6, 2012 21:44
-
-
Save starkfell/4228757 to your computer and use it in GitHub Desktop.
Mysqldump backup script for OpCfg.
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 | |
| # | |
| # OpCfg_MySQL_Backup Script | |
| # | |
| # Author: Ryan Irujo | |
| # Inception: 12.06.2012 | |
| # Last Modified: 12.06.2012 | |
| # | |
| # Description: Mysqldump backup script for OpCfg. | |
| # | |
| # | |
| # Changes: | |
| # | |
| # | |
| # | |
| MySQLUSER="root" | |
| MySQLPASS="" | |
| MySQLDB="opcfg" | |
| MySQLHOST=`hostname` | |
| DATE=`date +%m.%d.%y-%H%MEST` | |
| BACKUP_PATH="/usr/local/icinga/share/opcfg/sqldata/" | |
| if [ "$MySQLPASS" = "" ];then | |
| echo "MySQL Password for OpCfg must be provided" | |
| exit 2; | |
| fi | |
| `mysqldump -u$MySQLUSER -f -p$MySQLPASS $MySQLDB > OpCfg_Backup_$MySQLHOST\_$DATE.sql` | |
| `mv OpCfg_Backup_$MySQLHOST\_$DATE.sql $BACKUP_PATH/OpCfg_Backup_$MySQLHOST\_$DATE.sql` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment