aboutsummaryrefslogtreecommitdiff
path: root/grot.1
blob: 5cf00d0d7b391fd4eb9fe605f0a7a4d88ec5ad1b (plain)
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
.\" This file is part of Grot. -*- nroff -*-
.\" Copyright (C) 2009, 2010, 2013 Sergey Poznyakoff
.\"
.\" Grot is free software; you can redistribute it and/or modify
.\" it under the terms of the GNU General Public License as published by
.\" the Free Software Foundation; either version 3, or (at your option)
.\" any later version.
.\"
.\" Grot is distributed in the hope that it will be useful,
.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\" GNU General Public License for more details.
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with grot.  If not, see <http://www.gnu.org/licenses/>.
.TH grot "1" "August 6, 2013" "grot (grot 1.0)" "System Administrator's Manual"
.SH NAME
grot \- Gray's Rotation Tool for MySQL binary logs
.SH SYNOPSIS
\fBgrot\fR [\fB\-vnh\fR] [\fB\-H\fR[\fINAME\fR]] [\fB\-p\fR[\fIPASS\fR]] [\fB\-P\fR \fINUMBER\fR]\
 [\fB\-S\fR \fIPATH\fR] [\fB\-u\fR \fINAME\fR]
     [\fB\-\-host=\fR[\fINAME\fR]] [\fB\-\-password=\fR[\fIPASS\fR]] [\fB\-\-port=\fINUMBER\fR]
     [\fB\-\-socket=\fIPATH\fR] [\fB\-\-user=\fINAME\fR] [\fB\-\-verbose\fR]\
 [\fB\-\-dry\-run\fR]
     [\fB\-\-no\-flush\fR] [\fB\-\-keep=\fINUMBER\fR]
[\fB\-\-help\fR]
[\fB\-\-usage\fR]
[\fB\-\-version\fR]

.SH DESCRIPTION
\fBGrot\fR rotates MySQL binary log files on replication master
server.  It works by first determining what slaves are connected to
the server.  Then it connects to each slave and determines what
master log file it currently uses.  Finally, it removes those logs
on master that are older than the oldest of logs used by slaves.

Normally, \fBgrot\fR is executed as a cron job.  It is not necessary
to run it on the master server, it may as well be run on any machine
that can connect to the master SQL.

An account must be set up on master and each of the slaves for
\fBgrot\fR to operate.  The account on master must have the
\fBSUPER\fR, \fBPROCESS\fR and \fBRELOAD\fR privileges.  However, the
latter is not necessary if you use the \fB\-\-no\-flush\fR command
line option.

The slave accounts must be granted the \fBREPLICATION CLIENT\fR
privilege.

\fBGrot\fR uses configuration files to obtain the connection
parameters and account credentials of the master and slave servers.
See below for a descripton of these.

.SH OPTIONS
The following options modify the program's behavior:
.TP
\fB\-v\fR, \fB\-\-verbose\fR
Increase verbosity level.  Multiple instances of this option are
allowed.
.TP
\fB\-n\fR, \fB\-\-dry\-run\fR
Do not actually rotate the logs, only print what would have been done.
.TP
\fB\-\-no\-flush\fR
Do not flush logs after rotating.
.TP
\fB\-\-keep\fR=NUMBER
Keep NUMBER logs before the oldest one.
.PP
The following options set the connection and account parameters of the
master server.  They override the corresponding settings from the
configuration files:
.TP
\fB\-H\fR, \fB\-\-host\fR[=\fINAME\fR]
Set host name or IP address of the master MySQL server.
.TP
\fB\-p\fR, \fB\-\-password\fR[=\fIPASS\fR]
Set password of the MySQL user.  
.TP
\fB\-P\fR, \fB\-\-port\fR=\fINUMBER\fR
Set port number of the master MySQL server, if it differs from the
default 3306.
.TP
\fB\-S\fR, \fB\-\-socket\fR=\fISTRING\fR
Set socket file name.
.TP
\fB\-u\fR, \fB\-\-user\fR=\fINAME\fR
Set MySQL user name.  This user must have the following
privileges: PROCESS, SUPER.
.SS ""
Following are the informational options:
.TP
\fB\-h\fR, \fB\-\-help\fR
Give a concise help list.
.TP
\fB\-\-usage\fR
Give a short usage message.
.TP
\fB\-\-version\fR
Print program version.
.SH "CONFIGURATION FILES"
\fBGrot\fR reads its configuration from the following files:
.TP
\fB/etc/my.cnf\fR
Default MySQL configuration file.  \fBGrot\fR attempts to read master server
configuration from sections \fBgrot\fR and \fBclient\fR.
.TP
\fB/etc/grot.cnf\fR
Site-wide \fBgrot\fR configuration file.  See
.BR grot.cfg (5).
.TP
\fB~/.grot\fR
Per-user configuration file.  The tilde (\fB~\fR) here stands for the
user home directory.  See
.BR grot.cfg (5).
.SH "REPORTING BUGS"
Report bugs to <gray@gnu.org.ua>.
.\" The MANCGI variable is set by mansrv script on Ulysses.
.\" The download.inc file contains the default DOWNLOAD section
.\" for man-based doc pages.
.if "\V[MANCGI]"WEBDOC" \{\
.	ds package grot
.	ds version 1.0
.	so download.inc
\}
.SH "SEE ALSO"
.BR grot.cfg (5).
.SH COPYRIGHT
Copyright \(co 2009 Sergey Poznyakoff
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
.br
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

.\" Local variables:
.\" eval: (add-hook 'write-file-hooks 'time-stamp)
.\" time-stamp-start: ".TH grot \"1\" \""
.\" time-stamp-format: "%:B %:d, %:y"
.\" time-stamp-end: "\""
.\" time-stamp-line-limit: 16
.\" end:

Return to:

Send suggestions and report system problems to the System administrator.