1
Files
2020-11-23 14:55:36 +01:00

353 lines
16 KiB
Django/Jinja

#version=3.0_rc2
# DONT'T REMOVE THE PREVIOUS VERSION LINE!
#
# Uncomment to change the default values (shown after =)
# WARNING:
# This is not true for UMASK, CONFIG_prebackup and CONFIG_postbackup!!!
#
# Default values are stored in the script itself. Declarations in
# /etc/automysqlbackup/automysqlbackup.conf will overwrite them. The
# declarations in here will supersede all other.
# Edit $PATH if mysql and mysqldump are not located in /usr/local/bin:/usr/bin:/bin:/usr/local/mysql/bin
#PATH=${PATH}:FULL_PATH_TO_YOUR_DIR_CONTAINING_MYSQL:FULL_PATH_TO_YOUR_DIR_CONTAINING_MYSQLDUMP
# Basic Settings
# Username to access the MySQL server e.g. dbuser
{% if automysqlbackup_mysql_dump_username is defined %}
CONFIG_mysql_dump_username="{{ automysqlbackup_mysql_dump_username }}"
{% endif %}
# Password to access the MySQL server e.g. password
{% if automysqlbackup_mysql_dump_password is defined %}
CONFIG_mysql_dump_password="{{ automysqlbackup_mysql_dump_password }}"
{% endif %}
# Host name (or IP address) of MySQL server e.g localhost
{% if automysqlbackup_mysql_dump_host is defined %}
CONFIG_mysql_dump_host={{ automysqlbackup_mysql_dump_host }}
{% endif %}
# "Friendly" host name of MySQL server to be used in email log
# if unset or empty (default) will use CONFIG_mysql_dump_host instead
{% if automysqlbackup_mysql_dump_host_friendly is defined %}
CONFIG_mysql_dump_host_friendly="{{ automysqlbackup_mysql_dump_host_friendly }}"
{% endif %}
# Backup directory location e.g /backups
{% if automysqlbackup_backup_dir is defined %}
CONFIG_backup_dir="{{ automysqlbackup_backup_dir }}"
{% endif %}
# This is practically a moot point, since there is a fallback to the compression
# functions without multicore support in the case that the multicore versions aren't
# present in the system. Of course, if you have the latter installed, but don't want
# to use them, just choose no here.
# pigz -> gzip
# pbzip2 -> bzip2
{% if automysqlbackup_multicore is defined %}
CONFIG_multicore="{{ automysqlbackup_multicore }}"
{% endif %}
# Number of threads (= occupied cores) you want to use. You should - for the sake
# of the stability of your system - not choose more than (#number of cores - 1).
# Especially if the script is run in background by cron and the rest of your system
# has already heavy load, setting this too high, might crash your system. Assuming
# all systems have at least some sort of HyperThreading, the default is 2 threads.
# If you wish to let pigz and pbzip2 autodetect or use their standards, set it to
# 'auto'.
#CONFIG_multicore_threads=2
{% if automysqlbackup_multicore_threads is defined %}
CONFIG_multicore_threads="{{ automysqlbackup_multicore_threads }}"
{% endif %}
# Databases to backup
# List of databases for Daily/Weekly Backup e.g. ( 'DB1' 'DB2' 'DB3' ... )
# set to (), i.e. empty, if you want to backup all databases
#CONFIG_db_names=()
# You can use
#declare -a MDBNAMES=( "${DBNAMES[@]}" 'added entry1' 'added entry2' ... )
# INSTEAD to copy the contents of $DBNAMES and add further entries (optional).
{% if automysqlbackup_db_names is defined %}
CONFIG_db_names={{ automysqlbackup_db_names }}
{% endif %}
# List of databases for Monthly Backups.
# set to (), i.e. empty, if you want to backup all databases
{% if automysqlbackup_db_month_names is defined %}
CONFIG_db_month_names={{ automysqlbackup_db_month_names }}
{% endif %}
# List of DBNAMES to EXCLUDE if DBNAMES is empty, i.e. ().
{% if automysqlbackup_db_exclude is defined %}
CONFIG_db_exclude={{ automysqlbackup_db_exclude }}
{% endif %}
# List of tables to exclude, in the form db_name.table_name
# You may use wildcards for the table names, i.e. 'mydb.a*' selects all tables starting with an 'a'.
# However we only offer the wildcard '*', matching everything that could appear, which translates to the
# '%' wildcard in mysql.
{% if automysqlbackup_table_exclude is defined %}
CONFIG_table_exclude="{{ automysqlbackup_table_exclude }}"
{% endif %}
# Advanced Settings
# Rotation Settings
# Which day do you want monthly backups? (01 to 31)
# If the chosen day is greater than the last day of the month, it will be done
# on the last day of the month.
# Set to 0 to disable monthly backups.
{% if automysqlbackup_do_monthly is defined %}
CONFIG_do_monthly="{{ automysqlbackup_do_monthly }}"
{% endif %}
# Which day do you want weekly backups? (1 to 7 where 1 is Monday)
# Set to 0 to disable weekly backups.
#CONFIG_do_weekly="5"
{% if automysqlbackup_do_weekly is defined %}
CONFIG_do_weekly="{{ automysqlbackup_do_weekly }}"
{% endif %}
# Set rotation of daily backups. VALUE*24hours
# If you want to keep only today's backups, you could choose 1, i.e. everything older than 24hours will be removed.
{% if automysqlbackup_rotation_daily is defined %}
CONFIG_rotation_daily="{{ automysqlbackup_rotation_daily }}"
{% endif %}
# Set rotation for weekly backups. VALUE*24hours
#CONFIG_rotation_weekly=35
{% if automysqlbackup_rotation_weekly is defined %}
CONFIG_rotation_weekly="{{ automysqlbackup_rotation_weekly }}"
{% endif %}
# Set rotation for monthly backups. VALUE*24hours
#CONFIG_rotation_monthly=150
{% if automysqlbackup_rotation_monthly is defined %}
CONFIG_rotation_monthly="{{ automysqlbackup_rotation_monthly }}"
{% endif %}
# Server Connection Settings
# Set the port for the mysql connection
{% if automysqlbackup_mysql_dump_port is defined %}
CONFIG_mysql_dump_port={{ automysqlbackup_mysql_dump_port }}
{% endif %}
# Compress communications between backup server and MySQL server?
{% if automysqlbackup_mysql_dump_commcomp is defined %}
CONFIG_mysql_dump_commcomp="{{ automysqlbackup_mysql_dump_commcomp }}"
{% endif %}
# Use ssl encryption with mysqldump?
{% if automysqlbackup_mysql_dump_usessl is defined %}
CONFIG_mysql_dump_usessl="{{ automysqlbackup_mysql_dump_usessl }}"
{% endif %}
# For connections to localhost. Sometimes the Unix socket file must be specified.
{% if automysqlbackup_mysql_dump_socket is defined %}
CONFIG_mysql_dump_socket="{{ automysqlbackup_mysql_dump_socket }}"
{% endif %}
# The maximum size of the buffer for client/server communication. e.g. 16MB (maximum is 1GB)
{% if automysqlbackup_mysql_dump_max_allowed_packet is defined %}
CONFIG_mysql_dump_max_allowed_packet="{{ automysqlbackup_mysql_dump_max_allowed_packet }}"
{% endif %}
# This option sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with
# transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time
# when BEGIN was issued without blocking any applications.
#
# When using this option, you should keep in mind that only InnoDB tables are dumped in a consistent state. For
# example, any MyISAM or MEMORY tables dumped while using this option may still change state.
#
# While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents and
# binary log coordinates), no other connection should use the following statements: ALTER TABLE, CREATE TABLE,
# DROP TABLE, RENAME TABLE, TRUNCATE TABLE. A consistent read is not isolated from those statements, so use of
# them on a table to be dumped can cause the SELECT that is performed by mysqldump to retrieve the table
# contents to obtain incorrect contents or fail.
{% if automysqlbackup_mysql_dump_single_transaction is defined %}
CONFIG_mysql_dump_single_transaction="{{ automysqlbackup_mysql_dump_single_transaction }}"
{% endif %}
# http://dev.mysql.com/doc/refman/5.0/en/mysqldump.html#option_mysqldump_master-data
# --master-data[=value]
# Use this option to dump a master replication server to produce a dump file that can be used to set up another
# server as a slave of the master. It causes the dump output to include a CHANGE MASTER TO statement that indicates
# the binary log coordinates (file name and position) of the dumped server. These are the master server coordinates
# from which the slave should start replicating after you load the dump file into the slave.
#
# If the option value is 2, the CHANGE MASTER TO statement is written as an SQL comment, and thus is informative only;
# it has no effect when the dump file is reloaded. If the option value is 1, the statement is not written as a comment
# and takes effect when the dump file is reloaded. If no option value is specified, the default value is 1.
#
# This option requires the RELOAD privilege and the binary log must be enabled.
#
# The --master-data option automatically turns off --lock-tables. It also turns on --lock-all-tables, unless
# --single-transaction also is specified, in which case, a global read lock is acquired only for a short time at the
# beginning of the dump (see the description for --single-transaction). In all cases, any action on logs happens at
# the exact moment of the dump.
# ==================================================================================================================
# possible values are 1 and 2, which correspond with the values from mysqldump
# VARIABLE= , i.e. no value, turns it off (default)
#
{% if automysqlbackup_mysql_dump_master_data is defined %}
CONFIG_mysql_dump_master_data={{ automysqlbackup_mysql_dump_master_data }}
{% endif %}
# Included stored routines (procedures and functions) for the dumped databases in the output. Use of this option
# requires the SELECT privilege for the mysql.proc table. The output generated by using --routines contains
# CREATE PROCEDURE and CREATE FUNCTION statements to re-create the routines. However, these statements do not
# include attributes such as the routine creation and modification timestamps. This means that when the routines
# are reloaded, they will be created with the timestamps equal to the reload time.
#
# If you require routines to be re-created with their original timestamp attributes, do not use --routines. Instead,
# dump and reload the contents of the mysql.proc table directly, using a MySQL account that has appropriate privileges
# for the mysql database.
#
# This option was added in MySQL 5.0.13. Before that, stored routines are not dumped. Routine DEFINER values are not
# dumped until MySQL 5.0.20. This means that before 5.0.20, when routines are reloaded, they will be created with the
# definer set to the reloading user. If you require routines to be re-created with their original definer, dump and
# load the contents of the mysql.proc table directly as described earlier.
#
{% if automysqlbackup_mysql_dump_full_schema is defined %}
CONFIG_mysql_dump_full_schema="{{ automysqlbackup_mysql_dump_full_schema }}"
{% endif %}
# Backup status of table(s) in textfile. This is very helpful when restoring backups, since it gives an idea, what changed
# in the meantime.
{% if automysqlbackup_mysql_dump_dbstatus is defined %}
CONFIG_mysql_dump_dbstatus="{{ automysqlbackup_mysql_dump_dbstatus }}"
{% endif %}
# Backup dump settings
# Include CREATE DATABASE in backup?
{% if automysqlbackup_mysql_dump_create_database is defined %}
CONFIG_mysql_dump_create_database="{{ automysqlbackup_mysql_dump_create_database }}"
{% endif %}
# Separate backup directory and file for each DB? (yes or no)
{% if automysqlbackup_mysql_dump_use_separate_dirs is defined %}
CONFIG_mysql_dump_use_separate_dirs="{{ automysqlbackup_mysql_dump_use_separate_dirs }}"
{% endif %}
# Choose Compression type. (gzip or bzip2)
{% if automysqlbackup_mysql_dump_compression is defined %}
CONFIG_mysql_dump_compression="{{ automysqlbackup_mysql_dump_compression }}"
{% endif %}
# Store an additional copy of the latest backup to a standard
# location so it can be downloaded by third party scripts.
{% if automysqlbackup_mysql_dump_latest is defined %}
CONFIG_mysql_dump_latest="{{ automysqlbackup_mysql_dump_latest }}"
{% endif %}
# Remove all date and time information from the filenames in the latest folder.
# Runs, if activated, once after the backups are completed. Practically it just finds all files in the latest folder
# and removes the date and time information from the filenames (if present).'
{% if automysqlbackup_mysql_dump_latest_clean_filenames is defined %}
CONFIG_mysql_dump_latest_clean_filenames="{{ automysqlbackup_mysql_dump_latest_clean_filenames }}"
{% endif %}
# Create differential backups. Master backups are created weekly at #$CONFIG_do_weekly weekday. Between master backups,
# diff is used to create differential backups relative to the latest master backup. In the Manifest file, you find the
# following structure
# $filename md5sum $md5sum diff_id $diff_id rel_id $rel_id
# where each field is separated by the tabular character '\t'. The entries with $ at the beginning mean the actual values,
# while the others are just for readability. The diff_id is the id of the differential or master backup which is also in
# the filename after the last _ and before the suffixes begin, i.e. .diff, .sql and extensions. It is used to relate
# differential backups to master backups. The master backups have 0 as $rel_id and are thereby identifiable. Differential
# backups have the id of the corresponding master backup as $rel_id.
#
# To ensure that master backups are kept long enough, the value of $CONFIG_rotation_daily is set to a minimum of 21 days.
{% if automysqlbackup_mysql_dump_differential is defined %}
CONFIG_mysql_dump_differential="{{ automysqlbackup_mysql_dump_differential }}"
{% endif %}
# Notification setup
# What would you like to be mailed to you?
# - log : send only log file
# - files : send log file and sql files as attachments (see docs)
# - stdout : will simply output the log to the screen if run manually.
# - quiet : Only send logs if an error occurs to the MAILADDR.
{% if automysqlbackup_mail_mailcontent is defined %}
CONFIG_mailcontent="{{ automysqlbackup_mail_mailcontent }}"
{% endif %}
# Set the maximum allowed email size in k. (4000 = approx 5MB email [see docs])
{% if automysqlbackup_mail_maxattsize is defined %}
CONFIG_mail_maxattsize={{ automysqlbackup_mail_maxattsize }}
{% endif %}
# Allow packing of files with tar and splitting it in pieces of CONFIG_mail_maxattsize.
{% if automysqlbackup_mail_splitandtar is defined %}
CONFIG_mail_splitandtar="{{ automysqlbackup_mail_splitandtar }}"
{% endif %}
# Use uuencode instead of mutt. WARNING: Not all email clients work well with uuencoded attachments.
{% if automysqlbackup_mail_use_uuencoded_attachments is defined %}
CONFIG_mail_use_uuencoded_attachments="{{ automysqlbackup_mail_use_uuencoded_attachments }}"
{% endif %}
# Email Address to send mail to? (user@domain.com)
{% if automysqlbackup_mail_address is defined %}
CONFIG_mail_address="{{ automysqlbackup_mail_address }}"
{% endif %}
# Encryption
# Do you wish to encrypt your backups using openssl?
{% if automysqlbackup_encrypt is defined %}
CONFIG_encrypt="{{ automysqlbackup_encrypt }}"
{% endif %}
# Choose a password to encrypt the backups.
{% if automysqlbackup_encrypt_password is defined %}
CONFIG_encrypt_password="{{ automysqlbackup_encrypt_password }}"
{% endif %}
# Other
# Backup local files, i.e. maybe you would like to backup your my.cnf (mysql server configuration), etc.
# These files will be tar'ed, depending on your compression option CONFIG_mysql_dump_compression compressed and
# depending on the option CONFIG_encrypt encrypted.
#
# Note: This could also have been accomplished with CONFIG_prebackup or CONFIG_postbackup.
{% if automysqlbackup_backup_local_files is defined %}
CONFIG_backup_local_files={{ automysqlbackup_backup_local_files }}
{% endif %}
# Command to run before backups (uncomment to use)
{% if automysqlbackup_prebackup is defined %}
CONFIG_prebackup="{{ automysqlbackup_prebackup }}"
{% endif %}
# Command run after backups (uncomment to use)
{% if automysqlbackup_postbackup is defined %}
CONFIG_postbackup="{{ automysqlbackup_postbackup }}"
{% endif %}
# Uncomment to activate! This will give folders rwx------
# and files rw------- permissions.
#umask 0077
{% if automysqlbackup_umask is defined %}
umask {{ automysqlbackup_umask }}
{% endif %}
# dry-run, i.e. show what you are gonna do without actually doing it
# inactive: =0 or commented out
# active: uncommented AND =1
{% if automysqlbackup_dryrun is defined %}
CONFIG_dryrun={{ automysqlbackup_dryrun }}
{% endif %}