mfspatch

NAME

mfspatch - MooseFS patch tools

SYNOPSIS

mfscreatepatch [-?] [-d] [-f] [-c] [-o] [-m NUMBER] [-p OUTPUT_PATCH_FILENAME] PREVIOUS_SNAPSHOT CURRENT_SNAPSHOT

mfsapplypatch [-?] [-v] [-i] [-d] [-f] [-s POSITION] [-p INPUT_PATCH_FILENAME] OBJECT_TO_PATCH

mfsdumppatch [-?] [-s POSITION] [-p INPUT_PATCH_FILENAME]

DESCRIPTION

These tools are used to create and manipulate "patch files" that describe differences between two snapshotted directories on MooseFS. Such patches can later be applied to a different directory (on another instance of MooseFS or even on a different filesystem) for backup purposes.

The tools rely heavily on MooseFS snapshot mechanics to find the smallest subset of operations. They will work with "regular" directories, but then the patch file will just contain the whole file data content of the current directory.

mfscreatepatch creates a "patch" between two directories, i.e. a set of operations that need to be performed to turn the content of directory PREVIOUS_SNAPSHOT into the content of directory CURRENT_SNAPSHOT. These operations include (but are not limited to): creating and deleting filesystem objects, writing data to files, changing object attributes. The patch can be written to a file (option -p) or to stdout (and, for example, piped directly to mfsapplypatch).

mfsapplypatch reads provided patch (from stdin or from a file when option -p is used) and applies it to OBJECT_TO_PATCH.

mfsdumppatch shows in human-readable format what operations will be performed when applying the patch (it doesn't show written data, just that a write operation will be performed and length of written data).

GENERAL OPTIONS

-? - displays short usage message.

-v - verbose mode.

-i - ignore non important errors (such as ENOENT on delete, EEXIST on create).

-d - data only mode (try to create or apply patch without root privileges - fail when data can't be read or written).

-c - small changes mode - during the patch creation process differing chunks are compared and only different parts of chunks are incorporated into the patch file, instead of whole chunks

-f - force mode (create or apply patch ignoring all errors - can be run without root privileges).

-o - two pass hardlinks mode - during the patch creation additional pass through the snapshot's tree is performed to detect all hardlinks; it's a bit more time consuming, but guarantees that the resulting patch file will not include any redundant data

-p - name of 'patch' file - if not defined then stdin or stdout will be used.

-m - optional number of extra threads that will be used to create the patch, this will divide the patch into smaller files (N+1 files if N is provided as parameter); accepted values are 1 to 100; requires -p option

-s - seek to given position and start dumping or applying the patch from this position

REMARKS

Application to a filesystem different than MooseFS is not guaranteed, although most POSIX filesystems should work.

If one of the signals: USR1, USR2 or INFO (whichever one of them exists in the OS the tool is used on) is sent to the tool, it will display its progress to stderr.

If a patch application is interrupted, it can be applied again from the start with option -i and should always eventually succeed. Some operations might be performed twice in this case. If the patch application fails because of some internal error, the tool will display the position it ended its work on and this position should be used when trying to re-apply (option -s), to avoid re-applying the same data, and option -i is no longer necessary. If some previous position is known (i.e. because a signal was used to check progress of the tool before application failed), this can also be used, but then the -i option should be used.

If option -m is used, the tool starts to work in multi-threaded mode and it will create many patch files (option -p is obligatory in this case). Apply command will then also automatically work in multi-threaded mode. In multi-threaded mode N+1 files are created (N is the number of threads specified by the user). One file is the "main" file containing some of the metadata changes and references to "side" files, which contain file data changes and also some of the metadata changes. The name of the main file is the one supplied by -p option and the side files have additional suffixes predefined in the tool. If the apply tool encounters a patch in multi-file format, it will automatically create one additional thread per each side file.

For obvious reasons unix socket objects are ignored by these tools.

REPORTING BUGS

Report bugs to bugs@moosefs.com

Copyright Jakub Kruszona-Zawadzki, Saglabs SA

This file is part of MooseFS.

READ THIS BEFORE INSTALLING THE SOFTWARE. BY INSTALLING, ACTIVATING OR USING THE SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE TERMS AND CONDITIONS OF MooseFS LICENSE AGREEMENT FOR VERSION 1.7 AND HIGHER IN A SEPARATE FILE. THIS SOFTWARE IS LICENSED AS PROPRIETARY SOFTWARE. YOU DO NOT ACQUIRE ANY OWNERSHIP RIGHT, TITLE OR INTEREST IN OR TO ANY INTELLECTUAL PROPERTY OR OTHER PROPRIETARY RIGHTS.

SEE ALSO

mfsmount(8), mfstools(1), mfssnapshots(1)