-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathbackupmysql.conf
77 lines (55 loc) · 2.34 KB
/
backupmysql.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Ameir Abdeldayem
# http://www.ameir.net
# You are free to modify and distribute this code,
# so long as you keep my name and URL in it.
# your MySQL server's name
SERVER=`hostname -f`
# directory to backup to
BACKDIR=~/backups/mysql
# date format that is appended to filename
DATE=`date -u +'%F-%T'`
#----------------------MySQL Settings--------------------#
DBNAMES[0]="db1 db2" # databases you want to backup, separated by a space; leave empty to backup all databases on this host
DBUSER[0]="root" # MySQL username
DBPASS[0]="password" # MySQL password
DBHOST[0]="localhost" # your MySQL server's location (IP address is best)
DBPORT[0]="3306" # MySQL port
DBTABLES[0]="db1.table1 db1.table2 db2.table1" # tables you want to backup or exclude, separated by a space; leave empty to back up all tables
DBTABLESMATCH[0]="include" # include will backup ONLY the tables in DBTABLES, exclude will backup all tables BUT those in DBTABLES
DBOPTIONS[0]="--quick --single-transaction"
#----------------------Mail Settings--------------------#
# set to 'y' if you'd like to be emailed the backup (requires mutt)
MAIL=n
# email addresses to send backups to, separated by a space
EMAILS="[email protected] [email protected]"
SUBJECT="MySQL backup on $SERVER ($DATE)"
#----------------------Duplicity Settings--------------------#
DUPLICITY=n
DUPLICITY_OPTIONS="--no-encryption -v8 --s3-use-new-style"
DUPLICITY_TARGET_URL="s3+http://my-backups/db/"
#----------------------S3 Settings--------------------#
S3_UPLOAD=n
S3_PATH="my-backups/db/"
S3_OPTIONS=""
AWS_CLI_OPTIONS="--region us-east-1"
#----------------------FTP Settings--------------------#
# set "FTP=y" if you want to enable FTP backups
FTP=n
# FTP server settings; group each remote server using arrays
# you can have unlimited remote FTP servers
FTPHOST[0]="ftphost"
FTPUSER[0]="username"
FTPPASS[0]="password"
FTPDIR[0]="backups"
FTPPORT[0]="21"
# directory to backup to; if it doesn't exist, file will be uploaded to
# first logged-in directory; the array indices correspond to the FTP info above
#-------------------Deletion Settings-------------------#
# delete old files?
DELETE=n
# how many days of backups do you want to keep?
DAYS=30
#-------------------Compression Settings-------------------#
COMPRESSION_COMMAND="gzip -f -9"
COMPRESSION_EXTENSION="gz"
#----------------------End of Settings------------------#