FPART(1) | General Commands Manual | FPART(1) |
fpart
— Sort and
pack files into partitions.
fpart |
[-h ] [-V ]
-n num |
-f files |
-s size
[-i infile]
[-a ] [-o
outfile] [-e ]
[-v ] [-l ]
[-b ] [-y
pattern] [-Y
pattern] [-x
pattern] [-X
pattern] [-z ]
[-Z ] [-d
depth] [-D ]
[-L ] [-w
cmd] [-W
cmd] [-p
num] [-q
num] [-r
num] [FILE or DIR...] |
The fpart
utility helps you sort file
trees and pack them into bags (called "partitions").
-n
num-f
,
-s
or -L
.-f
files-s
and
-L
.-s
size-f
and -L
.-o
outfile-
”, then partitions will be printed
to stdout, with partition number used as a prefix (so you can grep
partitions you are interested in, or do whatever you want).-e
/
” to each directory
entry.-v
-l
-b
-y
pattern-Y
pattern-y
but case insensitive. This option may
not be available on your platform (at least FreeBSD and GNU/Linux support
it, Solaris does not).-x
pattern-y
and
-Y
. In this case, exclusion is performed after.
This option may be specified several times. It does not apply when
computing size of directories to be added as leaf entries (the computed
size will then include every file within directory).-X
pattern-x
but case insensitive. This option may
not be available on your platform (at least FreeBSD and GNU/Linux support
it, Solaris does not).-z
-d
or -D
options). This option can be useful for tools such as
rsync(1) to be able to recreate a full file tree when
used with fpart (e.g. using rsync's --files-from option). See the
-Z
option to also pack un-readable
directories.-Z
-z
. Treat un-readable directories as
empty, causing them to be packed anyway.-d
depth-D
-z
. Pack leaf directories: if a directory
contains files only, it will be packed as a single entry.-L
-s
). As a consequence, it can generate partitions
larger than the size specified with option -s
.
This option can be used in conjunction with options
-f
and -s
, but not with
option -n
.-w
cmdFPART_HOOKTYPE
("pre-part" or
"post-part"), FPART_PARTFILENAME
(current partition's output file name),
FPART_PARTNUMBER
(current partition number),
FPART_PARTSIZE
(current partition size),
FPART_PARTNUMFILES
(number of files in current
partition), FPART_PID
(PID of fpart). Note that
variables may or may not be defined, depending of requested options and
current partition's state when the hook is triggered. Also, note that
hooks are executed in a synchronous way while crawling filesystem, so 1)
avoid executing commands that take a long time to return as it slows down
filesystem crawling and 2) do not presume cwd (PWD) is the one fpart has
been started in, as it is regularly changed to speed up crawling (use
abolute paths within hooks).-W
cmd-w
, but executes cmd
when finishing a partition (after having closed last output file, if
any).Here are some examples:
fpart -n 3
-o var-parts /var
fpart
-s 4724464025 -o music-parts /path/to/music ./*.mp3
find /usr !
-type d | fpart -f 10000 -i - /home | grep '^0:'
du * | fpart -n 2
-a
Fpart has been written by Ganaël LAPLANCHE and is available under the BSD license on http://contribs.martymac.org
No bug known (yet).
November 18, 2011 | Debian |