-
Notifications
You must be signed in to change notification settings - Fork 1
/
help.txt
144 lines (87 loc) · 4.19 KB
/
help.txt
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
mysql-xtrabackup - use Percona's xtrabackup to back up a MySQL server
Usage:
mysql-xtrabackup [options]
OPTIONS:
Help:
--help: see this help
--help-install: see instructions to install innobackupex
Credentials:
By default, a defaults file is used to connect to the mysqld, the default
path for this is ~/.my.cnf
Behaviour here is defined by innobackupex, this script does no sanitising.
--defaults-file [path]
Explicitly set the path to the defaults file
--no-defaults-file
Don't use a defaults file
--username [user], --password [pass] and --hostname [host]
Specify credentials when not using a defaults file.
Output and logging:
--no-log
Don't write a log file; everything to STDOUT instead
--log-dir:
Directory in which to write a log. See 'label' below for info on log naming
Default: /var/log/mysql-xtrabackup/
Backing up:
--innobackupex [path]
path to the innobackupex binary. Default: /usr/bin/innobackupex
--innobackupex-option
Set an innobackupex option; call multiple times to set several options. To
avoid confusing the options parser, use the --opt=value syntax, eg:
--innobackupex-option=--parallel=10
--backups-dir [path]
path to the directory in which to keep the backups.
Default: /home/mysql-xtrabackup/
--label
A label to use for the backups. Influences the logfile's name, and normally
one of "daily", "weekly" or "monthly" but only by convention. It mey be any
string
--no-tar
By defalt, the resulting directory is gzipped and tarred, setting --no-tar
causes the backup to be left as a directory. This also disables the pruning.
--tar [command]
Tar invocation; passed two arguments, the name of the tarball to create and
the name of the directory to tar. Must, therefore, include the arguments.
Default: 'tar -czvf'
--max-days [num]
Number of days to keep backups for. When a label is set and tarring is not
disabled, on succesful taking of a backup, all tarballs older than this
number of days with this label are deleted. No pruning is done if this is
left unset.
--lockfile
Path to lockfile created to avoid having two processes running at the same
time. Default: /tmp/mysql-xtrabackup.lock
LABELS
Labels are used to distinguish between backups of a different purpose, most
likely those of a different period. When a label is set a subdirectory is
created in the backups directory named for it, and so the max-days set only
affects those.
Consider two cronsjobs:
0 3 1 * * mysql-xtrabackup --label monthly --max-days 90
0 17 * * * mysql-xtrabackup --label weekly --max-days 14
The first will be backed up into a directory /home/mysql-xtrabackup/monthly/,
and the pruning will delete backups in the monthly/ directory older than 90
days.
The second will use a directory at /home/mysql-xtrabackup/weekly/, and the
pruning will delete backups in weekly/ older than 14 days, but leave anything
in any other subdirectory.
If --label is unset, the backups just go into /home/mysql-xtrabackup, and
pruning is disabled.
The logfile is also named in accordance with the labelling. The intention is
to create a self-rotating log system. Daily logs are named for the day of the
week so there's always seven, for example.
The rules are:
Label | Pattern | Example
---------+------------------------------------+----------------------------
daily | <day name>-daily | mon-daily | tue-daily
weekly | <month name>-<day of month>-weekly | feb-19-weekly
monthly | <month name>-monthly | feb-monthly
hourly | <hour>h-hourly | 17h-hourly
empty | y-m-d_H:M:S | 2018-02-19_17:04:12
* | y-m-d_H:M:S_<label> | 2018-02-19_17:04:12_thing
That is, any non-empty string that's not daily, weekly, monthly or hourly will
just be appended verbatim to the end of the logfile's name.
DETECTING FAILURE
On succesful completion, the last line logged will be "Exiting OK" prefixed
with a timestamp, and an exit value of 0.
Any problems result in a non-zero exit status and a log-line with an error
message in it.