compress Long size file into multiple limited size xz file I have files of 28GB size.

I want to compress using .xz LZMA, with .xz chuncks of 1G (1024MB) size files...

MyFile.vdi -&gt; MyFile00.xz, MyFile01.xz, MyFile02.xz...


How do it in macOS?

EDIT

sh-3.2# xz -ek9vfc Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi
xz: Compressed data cannot be written to a terminal
xz: Try `xz --help' for more information.
sh-3.2# 


SECOND EDIT

USING

# xz -ek9vfc Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi

# xz -e9vfc &lt; Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi | split -b 1024m - Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi.xz


Here the output.

# ls -al Centos\ 7\ 1511\ 64bits_20170629\(with_dukto\).vdi*
-rw-------@ 1 _unknown  _unknown  17470324736 Jun 29 23:47 Centos 7 1511 64bits_20170629(with_dukto).vdi
-rw-r--r--  1 _unknown  _unknown   3898588580 Aug 22 22:19 Centos 7 1511 64bits_20170629(with_dukto).vdi.xz
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 12:15 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzaa
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 13:44 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzab
-rw-r--r--  1 _unknown  _unknown   1073741824 Aug 23 18:17 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzac
-rw-r--r--  1 _unknown  _unknown    677363108 Aug 23 21:44 Centos 7 1511 64bits_20170629(with_dukto).vdi.xzad
sh-3.2# 


Here the help

# xz -h
Usage: xz [OPTION]... [FILE]...
Compress or decompress FILEs in the .xz format.

  -z, --compress      force compression
  -d, --decompress    force decompression
  -t, --test          test compressed file integrity
  -l, --list          list information about .xz files
  -k, --keep          keep (don't delete) input files
  -f, --force         force overwrite of output file and (de)compress links
  -c, --stdout        write to standard output and don't delete input files
  -0 ... -9           compression preset; default is 6; take compressor *and*
                      decompressor memory usage into account before using 7-9!
  -e, --extreme       try to improve compression ratio by using more CPU time;
                      does not affect decompressor memory requirements
  -T, --threads=NUM   use at most NUM threads; the default is 1; set to 0
                      to use as many threads as there are processor cores
  -q, --quiet         suppress warnings; specify twice to suppress errors too
  -v, --verbose       be verbose; specify twice for even more verbose
  -h, --help          display this short help and exit
  -H, --long-help     display the long help (lists also the advanced options)
  -V, --version       display the version number and exit

With no FILE, or when FILE is -, read standard input.

Report bugs to &lt;lasse.collin@tukaani.org&gt; (in English or Finnish).
XZ Utils home page: &lt;http://tukaani.org/xz/&gt;
sh-3.2#
Use split. 

Example: 
xz -e9vfc &lt; yourFile.vdi | split -b 1024m - yourFile.vdi.xz.

This will split yourFile.vdi into compressed chunks of 1GB, suffixed by aa-zz. 

To reassemble, do cat yourFile.vdi.xz.* &gt; yourFile.xz

7-zip is MORE capable, but less ubiquitous. You'll want to checksum your backups and verify it every once in a while. Have a look at a GUI package of p7zip. It will let you select compression levels and volume sizes of 1GB... If you're doing this in an unattended batchjob, p7zip is dirtier. I can find one of my snippets if you need it.

A nice thing about xz though, is that you can assign n cores to a job. I believe it's the -T flag. Remember to nice it to 20 if you intend to use that mac for something other than a big paperweight if you use all cores at once.