.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.0102 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "PT-FIFO-SPLIT 1" .TH PT-FIFO-SPLIT 1 2025-01-01 "perl v5.40.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME pt\-fifo\-split \- Split files and pipe lines to a fifo without really splitting. .SH SYNOPSIS .IX Header "SYNOPSIS" Usage: pt-fifo-split [OPTIONS] [FILE] .PP pt-fifo-split splits FILE and pipes lines to a fifo. With no FILE, or when FILE is \-, read standard input. .PP Read hugefile.txt in chunks of a million lines without physically splitting it: .PP .Vb 2 \& pt\-fifo\-split \-\-lines 1000000 hugefile.txt \& while [ \-e /tmp/pt\-fifo\-split ]; do cat /tmp/pt\-fifo\-split; done .Ve .SH RISKS .IX Header "RISKS" Percona Toolkit is mature, proven in the real world, and well tested, but all database tools can pose a risk to the system and the database server. Before using this tool, please: .IP \(bu 4 Read the tool's documentation .IP \(bu 4 Review the tool's known "BUGS" .IP \(bu 4 Test the tool on a non-production server .IP \(bu 4 Backup your production server and verify the backups .SH DESCRIPTION .IX Header "DESCRIPTION" pt-fifo-split lets you read from a file as though it contains only some of the lines in the file. When you read from it again, it contains the next set of lines; when you have gone all the way through it, the file disappears. This works only on Unix-like operating systems. .PP You can specify multiple files on the command line. If you don't specify any, or if you use the special filename \f(CW\*(C`\-\*(C'\fR, lines are read from standard input. .SH OPTIONS .IX Header "OPTIONS" This tool accepts additional command-line arguments. Refer to the "SYNOPSIS" and usage information for details. .IP \-\-config 4 .IX Item "--config" type: Array .Sp Read this comma-separated list of config files; if specified, this must be the first option on the command line. .IP \-\-fifo 4 .IX Item "--fifo" type: string; default: /tmp/pt\-fifo\-split .Sp The name of the fifo from which the lines can be read. .IP \-\-force 4 .IX Item "--force" Remove the fifo if it exists already, then create it again. .IP \-\-help 4 .IX Item "--help" Show help and exit. .IP \-\-lines 4 .IX Item "--lines" type: int; default: 1000 .Sp The number of lines to read in each chunk. .IP \-\-offset 4 .IX Item "--offset" type: int; default: 0 .Sp Begin at the Nth line. If the argument is 0, all lines are printed to the fifo. If 1, then beginning at the first line, lines are printed (exactly the same as 0). If 2, the first line is skipped, and the 2nd and subsequent lines are printed to the fifo. .IP \-\-pid 4 .IX Item "--pid" type: string .Sp Create the given PID file. The tool won't start if the PID file already exists and the PID it contains is different than the current PID. However, if the PID file exists and the PID it contains is no longer running, the tool will overwrite the PID file with the current PID. The PID file is removed automatically when the tool exits. .IP \-\-statistics 4 .IX Item "--statistics" Print out statistics between chunks. The statistics are the number of chunks, the number of lines, elapsed time, and lines per second overall and during the last chunk. .IP \-\-version 4 .IX Item "--version" Show version and exit. .SH ENVIRONMENT .IX Header "ENVIRONMENT" The environment variable \f(CW\*(C`PTDEBUG\*(C'\fR enables verbose debugging output to STDERR. To enable debugging and capture all output to a file, run the tool like: .PP .Vb 1 \& PTDEBUG=1 pt\-fifo\-split ... > FILE 2>&1 .Ve .PP Be careful: debugging output is voluminous and can generate several megabytes of output. .SH ATTENTION .IX Header "ATTENTION" Using might expose passwords. When debug is enabled, all command line parameters are shown in the output. .SH "SYSTEM REQUIREMENTS" .IX Header "SYSTEM REQUIREMENTS" You need Perl, DBI, DBD::mysql, and some core packages that ought to be installed in any reasonably new version of Perl. .SH BUGS .IX Header "BUGS" For a list of known bugs, see . .PP Please report bugs at . Include the following information in your bug report: .IP \(bu 4 Complete command-line used to run the tool .IP \(bu 4 Tool "\-\-version" .IP \(bu 4 MySQL version of all servers involved .IP \(bu 4 Output from the tool including STDERR .IP \(bu 4 Input files (log/dump/config files, etc.) .PP If possible, include debugging output by running the tool with \f(CW\*(C`PTDEBUG\*(C'\fR; see "ENVIRONMENT". .SH DOWNLOADING .IX Header "DOWNLOADING" Visit to download the latest release of Percona Toolkit. Or, get the latest release from the command line: .PP .Vb 1 \& wget percona.com/get/percona\-toolkit.tar.gz \& \& wget percona.com/get/percona\-toolkit.rpm \& \& wget percona.com/get/percona\-toolkit.deb .Ve .PP You can also get individual tools from the latest release: .PP .Vb 1 \& wget percona.com/get/TOOL .Ve .PP Replace \f(CW\*(C`TOOL\*(C'\fR with the name of any tool. .SH AUTHORS .IX Header "AUTHORS" Baron Schwartz .SH "ABOUT PERCONA TOOLKIT" .IX Header "ABOUT PERCONA TOOLKIT" This tool is part of Percona Toolkit, a collection of advanced command-line tools for MySQL developed by Percona. Percona Toolkit was forked from two projects in June, 2011: Maatkit and Aspersa. Those projects were created by Baron Schwartz and primarily developed by him and Daniel Nichter. Visit to learn about other free, open-source software from Percona. .SH "COPYRIGHT, LICENSE, AND WARRANTY" .IX Header "COPYRIGHT, LICENSE, AND WARRANTY" This program is copyright 2011\-2024 Percona LLC and/or its affiliates, 2007\-2011 Baron Schwartz. .PP THIS PROGRAM IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. .PP This program 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, version 2; OR the Perl Artistic License. On UNIX and similar systems, you can issue `man perlgpl' or `man perlartistic' to read these licenses. .PP You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111\-1307 USA. .SH VERSION .IX Header "VERSION" pt-fifo-split 3.7.0