-
Notifications
You must be signed in to change notification settings - Fork 3
/
mysqldump.conf
executable file
·46 lines (41 loc) · 2.13 KB
/
mysqldump.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
###############################################################################################
#
# Konfigurationsdatei von mysql-backup.sh, sollte als /etc/she/mysqldump.conf verfügbar sein
# by Simon Skolik, [email protected]
#
###############################################################################################
#
# Backup User mit folgenden Befehl anlegen:
# mysql> GRANT SELECT, SHOW DATABASES, LOCK TABLES, SHOW VIEW, EVENT ON *.* TO 'backup'@'localhost' IDENTIFIED BY 'PASSWORT' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;
#
###############################################################################################
### mysql backup user ###
my_mysql_user="backup"
my_mysql_password="YOURBACKUP PASS"
## Additional parameters ##
# Sets additional parameters for the mysql dump. Per default the parameter
# --events is set. In older MySQL versions this parameter has to be removed,
# because it was not available until MySQL 5.3 (Red Hat 5 uses 5.1)
my_mysql_additional_parameters="--events"
### en-/disable functions ###
## to disable certain parts of the script comment the corresponding 'enable' variables
## (the 'disable' ones are just there to better illustrate that the function is disables, it still works without them)
# save every db in a different dump file? enabled/disabled
my_single_db_per_file="enabled"
# save a full dump of the whole MySQL DB? enabled/disabled
my_full_dump="enabled"
# delete older backup files? enabled/disabled
my_delete_old_files="enabled"
### backup variables ###
# timestamp, by default used by the backup file name
my_current_date="$(date +%F_%H%M%S)"
# sets the name of the backup files
my_backup_name="mysql-database-backup_$my_current_date"
# sets the location of the backup folder
my_backup_folder="/srv/mysql-backup"
# sets the name/location of the backup folder if all databases are saved in individual files,
# meaningless if this function is disabled
my_backup_single_db_folder="$my_backup_folder/$my_backup_name"
# sets the number of days after which backup files are deleted,
# meaningless if this function is disabled
my_backup_ttl=7