# pmlogcompress

## NAME



           **pmlogcompress** , **pmlogdecompress** - compress and decompress PCP
           archive files
    


## SYNOPSIS



           **pmlogcompress**[**-NV?**]  [**-A** _arg_] [**-c** _proglist_] [**-f** _prog_] [**-l** _limit_]
           [**-o** _type_] [**-Z** _min_] _archive_ ...
           **pmlogdecompress**[**-NV?**]  [**-t** _dir_] _archive_ ...
    


## DESCRIPTION



           **pmlogcompress** and **pmlogdecompress** support the compression and
           decompression of the files that make up a Performance Co-Pilot
           (PCP) archive; refer to LOGARCHIVE(5) for an explanation of the
           various files that are components of a PCP archive.
    
           The _archive_ arguments may be either the name of a single file in a
           PCP archive or the basename of a PCP archive, as in the style
           generated by pmlogbasename(1).  In the former case, **pmlogcompress**
           will compress (or **pmlogdecompress** will decompress) just that file,
           but in the latter case **pmlogcompress** will attempt to compress (or
           for **pmlogdecompress** to decompress) **all** the files that are part of
           the associated PCP archive.
    
           For decompression the suffix of the name of each file associated
           with _archive_ determines the decompression tool to be used.
    


## OPTIONS



           The available command line options are:
    
           **-A** _arg_ , **--arg** =_arg_
                _arg_ is used as an argument to the compression program; most
                likely useful with the **-f** option so that the choice of
                compression program is deterministic.
    
                The processing of _arg_ is not sophisticated, so embedded shell
                variables, escape characters, shell ``glob'' characters and
                white space should be avoided.
    
                Multiple **-A** options are allowed and **all** the _arg_ arguments
                will be used.
    
           **-c** _proglist_ , **--command** =_proglist_
                Depending on other command line options, and the availability
                of installed compression programs, the choice if program when
                compressing may vary.  The **-c** option allows a **list** of
                compression programs to be provided, either with multiple **-c**
                options and/or by separating program names in _proglist_ by a
                colon, in the style of the shell's **$PATH** notation.
    
                The default value for _proglist_ is **zstd:xz:bzip2:gzip**.
    
           **-f** _prog_ , **--use** =_prog_
                If only one program is to be considered for compression then
                this may be specified using the **-f** option.  The effect is the
                same as if only one **-c** option was used, and _proglist_
                contained exactly one program name, namely _prog_.
    
           **-l** _limit_ , **--lower-limit** =_limit_
                When compressing, do not consider files smaller than _limit_
                (bytes).
    
                The default value for _limit_ is 4096.
    
           **-N** , **--show-me**
                Do nothing, but show what commands would have been executed.
    
           **-o** _type_ , **--optimize** =_type_
                When compressing the **-o** option will try to pick the
                compression program from _proglist_ (see the **-c** option above)
                that does the ``best'' job, where _type_ may be **space** to choose
                the compression program that produces the smallest output
                file, or **time** to choose the compression program that uses the
                least CPU time.
    
                If _archive_ is an archive basename then the largest of the
                files that are part of the associated PCP archive is selected
                for the test, else _archive_ will be used for the test.
    
                Use of this option means each of the selected _archive_ files
                will be compressed multiple times, so it is likely that **-o**
                would be used in experiments with **-N**(and possibly **-V**) to
                determine the best compression tool for the local environment
                and PCP archives.
    
           **-t** _dir_ , **--dir** =_dir_
                When decompressing any compressed files will (by default) be
                replaced by their decompressed equivalent.  The **-t** option
                changes this behavior to create a duplicate, uncompressed
                _archive_ in the _dir_ directory.
    
                If _archive_ is a single file, then only that file is
                decompressed into _dir_ , but if _archive_ is an archive basename
                then **all** of the files of _archive_ will be copied, and possibly
                decompressed, into _dir_.
    
                If a file is **not** compressed, then an attempt will first be
                made to create a hard link in _dir_ with ln(1) and if this
                fails then a copy is made with cp(1).
    
                _dir_ must exist before **pmlogdecompress** is run.
    
           **-V** , **--verbose**
                Increase verbosity.
    
           **-Z** _min_ , **--min-zstd-size** =_min_
                **xz**(1) produces smaller compressed files for small input
                files, but at some point the input file becomes large enough
                that **zstd**(1) produces smaller compressed files and **zstd** is
                typically much faster.
    
                When both **xz** and **xstd** are in consideration (see the **-c** option
                above), then the **-Z** option allows the user to tune where the
                **xz** to **zstd** cut-over happens; input files smaller than _min_ (in
                bytes) will be compressed with **xz** else **zstd** will be used.
    
                The default value for _min_ is 52428800 (50MiB).
    
           **-?** , **--help**
                Display usage message and exit.
    


## NOTE



           For most users these tools will not be used directly because
           explicit compression and decompression of PCP archives is not
           required.
    
           Rather, if archive compression is enabled, then this will be done
           indirectly from the PCP archive managements scripts
           pmlogger_check(1), pmlogger_daily(1) and pmlogger_rewrite(1).
    
           Decompression is handled transparently during archive replay by
           the routines that implement the Performance Metrics Programming
           Interface (PMAPI).
    


* * *