mbout - reassemble a binary data stream has has been buffered through multiple files
mbout stands for Multiple Buffer OUTput. With the matching program mbin it provides a way to buffer large amounts of data to disk files which are then reassembled and written to the final target. In particular it is designed to buffer binary information destined for a streaming tape drive which must first be transmitted slowly over a network. Rather than writing the incoming data slowly to a tape drive, which results in stalling and increased drive wear, the data is first written into a buffer file. When that first buffer file is full mbin writes a lock file and a notification to the output. mbin then proceeds to write more input into the next buffer file. Simultaneously mbout will read the notification and copy the buffered data at full speed to the tape drive. When done copying data from a buffer file mbout will clear the associated lock file.
mbin writes the following information to its output, each on a separate line: the block size (an integer), the number of buffer files (an integer), the name of the first buffer file, the name of the second buffer file, etc., the name of the first lock file, the name of the second lock file, and so forth. This describes the buffers for the downstream program mbout. Then mbin writes a series of lines each of which contain this information: blocks_in_buffer buffer_file_number (two integers). This tells mbout that a block of data is ready to be copied. When mbin is done processing it writes either DONE message or ABORT message depending upon whether it completed processing normally or not. In response to either of those signals mbout will clean up by deleting all buffer and lock files. It will also close its output file and exit.
mbout may be obtained as part of the drm_tools package from: http://sourceforge.net/projects/drmtools/
On many operating systems mbout must be compiled with large file support if it is to read or write files above a few gigabytes in size. If compiled with the gcc compiler add the command line switches -D_LARGE_FILE_SOURCE -D_FILE_OFFSET_BITS=64 to include large file support. The -i option will show whether or not large files are supported.
-in <input_file> Read status messages from the specified file. (Default or - read from stdin.)
-out <out_file> Write the binary data stream to the specified file. (Default or - write to stdout.)
-log <log_file> Write error messages to the specified file. (Default or - write to stderr.)
-ve Echo every command to stderr or the log file. This may be useful for debugging.
-vr <N> Write a status message every N blocks.
-vt Write a final status message when processing completes, even if there has been no error. This message says how many blocks of a given blocksize were written to the output.
-h -help --help -? --?? Print the help message. (Default - do not print help message.)
-i Emit version, copyright, license and contact information.( Default - do not emit information.)
% mbout -h List the the command line options.
% (ssh remotemachine ’dump -f - filesystem’) | mbin | mbout > /dev/tapedrive Buffer the binary input from the remote machine through two 15Gb local files.
% (ssh remotemachine ’dump -f - filesystem’) | mbin | mbout -vr 1000 -vt > /dev/tapedrive As above but emit a status message every 1000 blocks and when processing completes.
mbin(1), buffer(1), mbuffer(1)
GNU General Public License 2
Copyright (C) 2006 David Mathog and Caltech.
David Mathog, Biology Division, Caltech <firstname.lastname@example.org>
|drm_tools||mbout (1)||1.0.0 OCT 23 2006|