-
Notifications
You must be signed in to change notification settings - Fork 1
/
mysqlbackup.1.include
92 lines (81 loc) · 3.63 KB
/
mysqlbackup.1.include
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
$Id$
[SEE ALSO]
.BR mysqldump (1),
.BR mysqlcheck (1),
.BR mysql (1),
.BR periodic.conf (5),
.BR periodic (8)
[USAGE]
\fBmysqlbackup\fR exits on error in mysqldump(1) execution unless \fB-I\fR
option given. On exit forced by some error, \fBmysqlbackup\fR clean up its
workdir and backup does not created. You may want to track \fBmysqlbackup\fR's
errors on a scheduled jobs to avoid the situation when no backups created at
all when something prevents \fBmysqlbackup\fR from normal execution. Check
\fB.done\fR flag-file within destination directory. Once backup succeeded, this
file is created and timestamp is written to it.
.P
\fBmysqlbackup\fR package comes with a number of
.BR periodic(8)
scripts allowing to create periodic backups even more transparently. There is
number of options suitable for
.BR periodic.conf(5)
that can be used to provide a more accurate configuration to run
\fBmysqlbackup\fR:
.IP \fImysqlbackup_enable\fR
(bool) enables or disables \fBmysqlbackup\fR tool to run with
.BR periodic(8).
The default is "no". If enabled, \fBmysqlbackup\fR will run by a daily
schedule.
.IP \fImysqlbackup_schedule\fR
(str) run \fBmysqlbackup\fR either \fIdaily\fR or \fIweekly\fR or
\fImonthly\fR. As mentioned above - the default schedule is \fIdaily\fR.
.IP \fImysqlbackup_args\fR
(str)
pass to \fBmysqlbackup\fR program additional arguments. By default they are
set to \fB-av\fR, which means to backup all the available databases. Note that
this variable automatically adjusted with \fB-l\fR option based upon selected
\fImysqlbackup_schedule\fR. With \fIweekly\fR schedule backups are stored for
30 days; that is, there will be at least four last backups created on every
Saturday, for example. As for \fImonthly\fR schedule, backups stays untouched
for 120 days, allowing to have minimum four last backups created on the every
first day (also, as example) of last months.
.P
If you need to create backups with a bit different schedule - just add command
with desired arguments and flags to your
.BR crontab(1)
to create regular MySQL backups. In order to use mysqlbackup as periodic job -
do not forget to allow
.BR periodic(8)
to run \fBmysqlbackup\fR by setting \fImysqlbackup_enable\fR to `yes' in either
\fI/etc/periodic.conf.local\fR or \fI/etc/periodic.conf\fR file. Check
.BR periodic.conf(5)
for details.
.P
[ENVIRONMENT]
\fBMYSQL_PREFIX\fR environment variable specifies your MySQL
installation prefix. All used MySQL binaries (mysqldump, mysql, mysqlcheck)
will be searched within this prefix at `bin' directory.
\fBDEBUG_IDENT\fR environment variable controls log messages appearance. In
verbose mode, by default, log messages from \fBmysqlbackup\fR prefixed with
timestamp, process name and PID. When logging to syslog this may not be
desired. To disable prefix in log messages, set DEBUG_IDENT environment to
"no".
[SECURITY]
You should keep your password in secure.
The method of specifying your MySQL password with \fB-p\fR option must be
considered \fIextremely insecure\fR and should not be used. Your password
becomes visible to system status programs such as
.BR ps(1)
that may be invoked by other users to display command lines.
Store your password in an option file. For example, you can list your password
in the [client] section of the \fI.my.cnf\fR file in your home directory:
.IP
[client]
password=your_pass
.PP
To keep the password safe, the file should not be accessible to anyone but
yourself. To ensure this, set the file access mode to \fB400\fR or \fB600\fR.
Users of MySQL 5.6+ may use "login path" feature with \fB-x\fR option.
[AVAILABILITY]
The latest version of this distribution is available on-line from:
https://mysqlbackup.googlecode.com