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