Recently i want to backup some MySQL Database to this i have used Automysqlbackup tool.
this tool backup the Databases daily weekly and Monthly.
# sudo apt-get install automysqlbackupthis tool backup the Databases daily weekly and Monthly.
- To Install the automysqlbackup
- Start the Service
- Config Files are stored in /etc/default/automysqlbackup
- uncomment the Following Lines.
# Username to access the MySQL server e.g. dbuser
USERNAME=`grep user /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'`
# Username to access the MySQL server e.g. password
PASSWORD=`grep password /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'`
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost
# reading the mysql folder content. Feel free to replace by something else.
DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ `
# This one does a list of dbs using a MySQL statement.
DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | grep -v ^information_schema$ | tr \\\r\\\n ,\ `
# root, with Unix rights 0600.
BACKUPDIR="/var/lib/automysqlbackup"
# List of DBBNAMES for Monthly Backups.
MDBNAMES="mysql $dbname "
USERNAME=`grep user /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'`
# Username to access the MySQL server e.g. password
PASSWORD=`grep password /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'`
# Host name (or IP address) of MySQL server e.g localhost
DBHOST=localhost
# reading the mysql folder content. Feel free to replace by something else.
DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ `
# This one does a list of dbs using a MySQL statement.
DBNAMES=`mysql --defaults-file=/etc/mysql/debian.cnf --execute="SHOW DATABASES" | awk '{print $1}' | grep -v ^Database$ | grep -v ^mysql$ | grep -v ^performance_schema$ | grep -v ^information_schema$ | tr \\\r\\\n ,\ `
# root, with Unix rights 0600.
BACKUPDIR="/var/lib/automysqlbackup"
# List of DBBNAMES for Monthly Backups.
MDBNAMES="mysql $dbname "
0 comments:
Post a Comment