2009-09-16 14:03:18 +02:00
'\" t
2009-05-25 11:59:47 +02:00
. \"
2024-09-03 19:15:59 +02:00
.TH "\fBMARIADB-HOTCOPY\fR" "1" "3 September 2024" "MariaDB 11.4" "MariaDB Database System"
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * set default formatting
. \" -----------------------------------------------------------------
2009-05-25 11:59:47 +02:00
. \" disable hyphenation
.nh
. \" disable justification (adjust text to left margin only)
.ad l
2009-09-16 14:03:18 +02:00
. \" -----------------------------------------------------------------
. \" * MAIN CONTENT STARTS HERE *
. \" -----------------------------------------------------------------
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy
2009-09-16 14:03:18 +02:00
. \" dumping: databases and tables
. \" backups: databases and tables
. \" databases: dumping
. \" tables: dumping
2009-05-25 11:59:47 +02:00
.SH "NAME"
2024-09-03 19:15:59 +02:00
mariadb-hotcopy \- a database backup program (mariadb-hotcopy is now a symlink to mariadb-hotcopy)
2009-05-25 11:59:47 +02:00
.SH "SYNOPSIS"
2024-09-03 19:15:59 +02:00
.HP \w '\fBmariadb-hotcopy\ \fR \fB \fI arguments\fR\fR\ 'u
\fB mariadb-hotcopy \fR \fB \fI arguments\fR \fR
2009-05-25 11:59:47 +02:00
.SH "DESCRIPTION"
.PP
2024-09-03 19:15:59 +02:00
\fB mariadb-hotcopy\fR
2009-09-16 14:03:18 +02:00
is a Perl script that was originally written and contributed by Tim Bunce\& . It uses
2010-04-28 15:06:11 +02:00
FLUSH TABLES,
LOCK TABLES, and
2009-05-25 11:59:47 +02:00
cp
or
scp
2010-04-28 15:06:11 +02:00
to make a database backup\& . It is a fast way to make a backup of the database or single tables, but it can be run only on the same machine where the database directories are located\& .
2024-09-03 19:15:59 +02:00
\fB mariadb-hotcopy\fR
2009-05-25 11:59:47 +02:00
works only for backing up
MyISAM
and
ARCHIVE
2009-09-16 14:03:18 +02:00
tables\& . It runs on Unix and NetWare\& .
2010-04-28 15:06:11 +02:00
.PP
To use
2024-09-03 19:15:59 +02:00
\fB mariadb-hotcopy\fR , you must have read access to the files for the tables that you are backing up, the
2010-04-28 15:06:11 +02:00
SELECT
privilege for those tables, the
RELOAD
privilege (to be able to execute
FLUSH TABLES), and the
LOCK TABLES
privilege (to be able to lock the tables)\& .
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2024-09-03 19:15:59 +02:00
shell> \fB mariadb-hotcopy \fR \fB \fI db_name\fR \fR \fB [\fR \fB \fI /path/to/new_directory\fR \fR \fB ]\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2024-09-03 19:15:59 +02:00
shell> \fB mariadb-hotcopy \fR \fB \fI db_name_1\fR \fR \fB \& .\& .\& . \fR \fB \fI db_name_n\fR \fR \fB \fR \fB \fI /path/to/new_directory\fR \fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
Back up tables in the given database that match a regular expression:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2024-09-03 19:15:59 +02:00
shell> \fB mariadb-hotcopy \fR \fB \fI db_name\fR \fR \fB \& ./\fR \fB \fI regex\fR \fR \fB /\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
The regular expression for the table name can be negated by prefixing it with a tilde (\(lq ~\(rq ):
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2024-09-03 19:15:59 +02:00
shell> \fB mariadb-hotcopy \fR \fB \fI db_name\fR \fR \fB \& ./~\fR \fB \fI regex\fR \fR \fB /\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.PP
2024-09-03 19:15:59 +02:00
\fB mariadb-hotcopy\fR
2010-04-28 15:06:11 +02:00
supports the following options, which can be specified on the command line or in the
2024-09-03 19:15:59 +02:00
[mariadb-hotcopy]
2010-04-28 15:06:11 +02:00
and
[client]
option file groups\& .
2009-09-16 14:03:18 +02:00
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: help option
. \" help option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- help\fR ,
\fB \- ?\fR
.sp
2009-09-16 14:03:18 +02:00
Display a help message and exit\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: addtodest option
. \" addtodest option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- addtodest\fR
.sp
2009-09-16 14:03:18 +02:00
Do not rename target directory (if it exists); merely add files to it\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: allowold option
. \" allowold option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- allowold\fR
.sp
Do not abort if a target exists; rename it by adding an
_old
2009-09-16 14:03:18 +02:00
suffix\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: checkpoint option
. \" checkpoint option: mariadb-hotcopy
2009-09-16 14:03:18 +02:00
\fB \- \- checkpoint=\fR \fB \fI db_name\fR \fR \fB \& .\fR \fB \fI tbl_name\fR \fR
2009-05-25 11:59:47 +02:00
.sp
Insert checkpoint entries into the specified database
\fI db_name\fR
and table
2009-09-16 14:03:18 +02:00
\fI tbl_name\fR \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: chroot option
. \" chroot option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- chroot=\fR \fB \fI path\fR \fR
.sp
Base directory of the
\fB chroot\fR
jail in which
2024-09-03 19:15:59 +02:00
\fB mariadbd\fR
2009-09-16 14:03:18 +02:00
operates\& . The
2009-05-25 11:59:47 +02:00
\fI path\fR
value should match that of the
\fB \- \- chroot\fR
option given to
2024-09-03 19:15:59 +02:00
\fB mariadbd\fR \& .
2009-09-16 14:03:18 +02:00
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: debug option
. \" debug option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- debug\fR
.sp
2009-09-16 14:03:18 +02:00
Enable debug output\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: dryrun option
. \" dryrun option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- dryrun\fR ,
\fB \- n\fR
.sp
2009-09-16 14:03:18 +02:00
Report actions without performing them\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: flushlog option
. \" flushlog option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- flushlog\fR
.sp
2009-09-16 14:03:18 +02:00
Flush logs after all tables are locked\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: host option
. \" host option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- host=\fR \fB \fI host_name\fR \fR ,
\fB \- h \fR \fB \fI host_name\fR \fR
.sp
2009-09-16 14:03:18 +02:00
The host name of the local host to use for making a TCP/IP connection to the local server\& . By default, the connection is made to
2009-05-25 11:59:47 +02:00
localhost
2009-09-16 14:03:18 +02:00
using a Unix socket file\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: keepold option
. \" keepold option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- keepold\fR
.sp
2009-09-16 14:03:18 +02:00
Do not delete previous (renamed) target when done\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: method option
. \" method option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- method=\fR \fB \fI command\fR \fR
.sp
The method for copying files (cp
or
2010-04-28 15:06:11 +02:00
scp)\& . The default is
cp\& .
2009-09-16 14:03:18 +02:00
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: noindices option
. \" noindices option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- noindices\fR
.sp
2010-04-28 15:06:11 +02:00
Do not include full index files for
MyISAM
tables in the backup\& . This makes the backup smaller and faster\& . The indexes for reloaded tables can be reconstructed later with
2009-09-16 14:03:18 +02:00
\fB myisamchk \- rq\fR \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: old-server option
. \" old-server option: mariadb-hotcopy
2015-09-09 14:32:52 +02:00
\fB \- \- old\- server\fR
.sp
Connect to old MySQL-server (before v5.5) which doesn't have FLUSH TABLES WITH READ LOCK fully implemented.\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: password option
. \" password option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- password=\fR \fB \fI password\fR \fR ,
\fB \- p\fR \fB \fI password\fR \fR
.sp
2015-09-09 14:32:52 +02:00
The password to use when connecting to the server\& . The password value is not optional for this option, unlike for other MariaDB programs\& .
2009-09-16 14:03:18 +02:00
.sp
2015-09-09 14:32:52 +02:00
Specifying a password on the command line should be considered insecure\& . You can use an option file to avoid giving the password on the command line\& .
2009-09-16 14:03:18 +02:00
.RE
2009-05-25 11:59:47 +02:00
.sp
2009-09-16 14:03:18 +02:00
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: port option
. \" port option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- port=\fR \fB \fI port_num\fR \fR ,
\fB \- P \fR \fB \fI port_num\fR \fR
.sp
2009-09-16 14:03:18 +02:00
The TCP/IP port number to use when connecting to the local server\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: quiet option
. \" quiet option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- quiet\fR ,
\fB \- q\fR
.sp
2009-09-16 14:03:18 +02:00
Be silent except for errors\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: record_log_pos option
. \" record_log_pos option: mariadb-hotcopy
2009-09-16 14:03:18 +02:00
\fB \- \- record_log_pos=\fR \fB \fI db_name\fR \fR \fB \& .\fR \fB \fI tbl_name\fR \fR
2009-05-25 11:59:47 +02:00
.sp
Record master and slave status in the specified database
\fI db_name\fR
and table
2009-09-16 14:03:18 +02:00
\fI tbl_name\fR \& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: regexp option
. \" regexp option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- regexp=\fR \fB \fI expr\fR \fR
.sp
2009-09-16 14:03:18 +02:00
Copy all databases with names that match the given regular expression\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: resetmaster option
. \" resetmaster option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- resetmaster\fR
.sp
2009-09-16 14:03:18 +02:00
Reset the binary log after locking all the tables\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: resetslave option
. \" resetslave option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- resetslave\fR
.sp
Reset the
2009-09-16 14:03:18 +02:00
master\& .info
file after locking all the tables\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: socket option
. \" socket option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- socket=\fR \fB \fI path\fR \fR ,
\fB \- S \fR \fB \fI path\fR \fR
.sp
2010-04-28 15:06:11 +02:00
The Unix socket file to use for connections to
localhost\& .
2009-09-16 14:03:18 +02:00
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: suffix option
. \" suffix option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- suffix=\fR \fB \fI str\fR \fR
.sp
2010-04-28 15:06:11 +02:00
The suffix to use for names of copied databases\& .
2009-09-16 14:03:18 +02:00
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: tmpdir option
. \" tmpdir option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- tmpdir=\fR \fB \fI path\fR \fR
.sp
2009-09-16 14:03:18 +02:00
The temporary directory\& . The default is
/tmp\& .
.RE
.sp
.RS 4
.ie n \{ \
\h '-04'\(bu \h '+03'\c
. \}
.el \{ \
.sp -1
.IP \(bu 2 .3
. \}
2024-09-03 19:15:59 +02:00
. \" mariadb-hotcopy: user option
. \" user option: mariadb-hotcopy
2009-05-25 11:59:47 +02:00
\fB \- \- user=\fR \fB \fI user_name\fR \fR ,
\fB \- u \fR \fB \fI user_name\fR \fR
.sp
2015-09-09 14:32:52 +02:00
The MariaDB user name to use when connecting to the server\& .
2009-05-25 11:59:47 +02:00
.RE
.PP
Use
perldoc
for additional
2024-09-03 19:15:59 +02:00
\fB mariadb-hotcopy\fR
2009-05-25 11:59:47 +02:00
documentation, including information about the structure of the tables needed for the
\fB \- \- checkpoint\fR
and
\fB \- \- record_log_pos\fR
options:
.sp
2009-09-16 14:03:18 +02:00
.if n \{ \
.RS 4
. \}
2009-05-25 11:59:47 +02:00
.nf
2024-09-03 19:15:59 +02:00
shell> \fB perldoc mariadb-hotcopy\fR
2009-05-25 11:59:47 +02:00
.fi
2009-09-16 14:03:18 +02:00
.if n \{ \
2009-05-25 11:59:47 +02:00
.RE
2009-09-16 14:03:18 +02:00
. \}
2009-05-25 11:59:47 +02:00
.SH "COPYRIGHT"
2009-09-16 14:03:18 +02:00
.br
2009-05-25 11:59:47 +02:00
.PP
2024-09-03 19:15:59 +02:00
Copyright 2007-2008 MySQL AB, 2008-2010 Sun Microsystems, Inc., 2010-2024 MariaDB Foundation
2009-05-25 11:59:47 +02:00
.PP
This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License.
.PP
This documentation 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.
.PP
2019-05-11 21:29:06 +03:00
You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA or see http://www.gnu.org/licenses/.
2009-09-16 14:03:18 +02:00
.sp
2009-05-25 11:59:47 +02:00
.SH "SEE ALSO"
2015-09-09 14:32:52 +02:00
For more information, please refer to the MariaDB Knowledge Base, available online at https://mariadb.com/kb/
2009-05-25 11:59:47 +02:00
.SH AUTHOR
2015-09-09 14:32:52 +02:00
MariaDB Foundation (http://www.mariadb.org/).