| 1 |
# By default, the Debian version of automysqlbackup will use: |
| 2 |
# mysqldump --defaults-file=/etc/mysql/debian.cnf |
| 3 |
# but you might want to overwrite with a specific user & pass. |
| 4 |
# To do this, simply edit bellow. |
| 5 |
|
| 6 |
# Username to access the MySQL server e.g. dbuser |
| 7 |
#USERNAME=`grep user /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'` |
| 8 |
|
| 9 |
# Username to access the MySQL server e.g. password |
| 10 |
#PASSWORD=`grep password /etc/mysql/debian.cnf | tail -n 1 | cut -d"=" -f2 | awk '{print $1}'` |
| 11 |
|
| 12 |
# Host name (or IP address) of MySQL server e.g localhost |
| 13 |
DBHOST=localhost |
| 14 |
|
| 15 |
# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3" |
| 16 |
# Note that it's absolutely normal that the db named "mysql" is not in this |
| 17 |
# list, as it's added later by the script. See the MDBNAMES directives below |
| 18 |
# in this file (advanced options). |
| 19 |
# This is ONLY a convenient default, if you don't like it, don't complain |
| 20 |
# and write your own. |
| 21 |
# The following is a quick hack that will find the names of the databases by |
| 22 |
# reading the mysql folder content. Feel free to replace by something else. |
| 23 |
# DBNAMES=`find /var/lib/mysql -mindepth 1 -maxdepth 1 -type d | cut -d'/' -f5 | grep -v ^mysql\$ | tr \\\r\\\n ,\ ` |
| 24 |
# This one does a list of dbs using a MySQL statement. |
| 25 |
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 ,\ ` |
| 26 |
|
| 27 |
# Backup directory location e.g /backups |
| 28 |
# Folders inside this one will be created (daily, weekly, etc.), and the |
| 29 |
# subfolders will be database names. Note that backups will be owned by |
| 30 |
# root, with Unix rights 0600. |
| 31 |
BACKUPDIR="/var/lib/automysqlbackup" |
| 32 |
|
| 33 |
# Mail setup |
| 34 |
# What would you like to be mailed to you? |
| 35 |
# - log : send only log file |
| 36 |
# - files : send log file and sql files as attachments (see docs) |
| 37 |
# - stdout : will simply output the log to the screen if run manually. |
| 38 |
# - quiet : Only send logs if an error occurs to the MAILADDR. |
| 39 |
MAILCONTENT="quiet" |
| 40 |
|
| 41 |
# Set the maximum allowed email size in k. (4000 = approx 5MB email [see |
| 42 |
# docs]) |
| 43 |
MAXATTSIZE="4000" |
| 44 |
|
| 45 |
# Email Address to send mail to? ([email protected]) |
| 46 |
MAILADDR="root" |
| 47 |
|
| 48 |
# ============================================================ |
| 49 |
# === ADVANCED OPTIONS ( Read the doc's below for details )=== |
| 50 |
#============================================================= |
| 51 |
|
| 52 |
# List of DBBNAMES for Monthly Backups. |
| 53 |
MDBNAMES="mysql $DBNAMES" |
| 54 |
|
| 55 |
# List of DBNAMES to EXLUCDE if DBNAMES are set to all (must be in " quotes) |
| 56 |
DBEXCLUDE="" |
| 57 |
|
| 58 |
# Include CREATE DATABASE in backup? |
| 59 |
CREATE_DATABASE=yes |
| 60 |
|
| 61 |
# Separate backup directory and file for each DB? (yes or no) |
| 62 |
SEPDIR=yes |
| 63 |
|
| 64 |
# Which day do you want weekly backups? (1 to 7 where 1 is Monday) |
| 65 |
DOWEEKLY=6 |
| 66 |
|
| 67 |
# Which day of the month to execute the monthly backup (00 = no monthly backup) |
| 68 |
# Two digit required |
| 69 |
DOMONTHLY=01 |
| 70 |
|
| 71 |
# Choose Compression type. (gzip or bzip2) |
| 72 |
COMP=gzip |
| 73 |
|
| 74 |
# Compress backups on the fly with gzip or bzip2 (yes or no) |
| 75 |
COMPDIRECT=no |
| 76 |
|
| 77 |
# Compress communications between backup server and MySQL server? |
| 78 |
COMMCOMP=no |
| 79 |
|
| 80 |
# Additionally keep a copy of the most recent backup in a seperate |
| 81 |
# directory. |
| 82 |
LATEST=no |
| 83 |
|
| 84 |
# The maximum size of the buffer for client/server communication. e.g. 16MB |
| 85 |
# (maximum is 1GB) |
| 86 |
MAX_ALLOWED_PACKET= |
| 87 |
|
| 88 |
# For connections to localhost. Sometimes the Unix socket file must be |
| 89 |
# specified. |
| 90 |
SOCKET= |
| 91 |
|
| 92 |
# Command to run before backups (uncomment to use) |
| 93 |
#PREBACKUP="/etc/mysql-backup-pre" |
| 94 |
|
| 95 |
# Command run after backups (uncomment to use) |
| 96 |
#POSTBACKUP="/etc/mysql-backup-post" |
| 97 |
|
| 98 |
# Backup of stored procedures and routines (comment to remove) |
| 99 |
ROUTINES=yes |
| 100 |
|
| 101 |
# Mysqldump additional option (like "--single-transaction") |
| 102 |
OPTIONS="" |