Closed
Description
It seems that Apple has included a command line utility that can create .yaa archives since High Sierra... but there don't seem to be a lot of articles about it online... I tried it on High Sierra and it seems to work well... it's multithreaded, it can use different compression formats (Apple's LZFSE is default, but it can also use LZMA, LZ4, ZLIB or LZVN... or not compress) and it can optionally include extended attributes also.
There doesn't seem to be a way to set a compression level, but you can set a larger block size for better compression.
Usage: yaa command <options>
Commands:
extract extract files from an archive
list list the contents of an archive
convert convert an archive into another
archive archive the contents of a directory
info show archive info
manifest alias for 'archive -manifest'
index alias for 'convert -index'
manifest-to-bom convert a YAA manifest to BOM
verify verify dir contents against YAA manifest
Options:
-v increase verbosity level to stderr. Default is silent operation
-h show usage and quit
-t nWorkerThreads number of threads to run for compression/decompression, default is 8 on this machine
-wt nWriterThreads number of writer threads to run, default is nWorkerThreads ('extract' only)
-d targetDir target directory, default is current directory
-o outFile output file, default is stdout
-a <algorithm> compression algorithm for archive payload
-b <size> compression block size for archive payload
'archive' default compression: lzfse 4m
'manifest','index','combine' default compression: lzfse 1m
-i inFile input file, default is stdin
-ioffset inOffset bytes to skip at the beginning of inFile, default is 0
-isize inSize bytes to read from inFile, default -1 = read the entire file
-iindex inIndex input index file, must be a YAA index of the input archive
-ignore-eperm ignore EPERM errors when setting files attributes
-include-path-list listFile file containing a list of paths to include (one per line, empty lines ignored); this option can be specified multiple times
-exclude-path-list listFile file containing a list of paths to exclude (one per line, empty lines ignored); this option can be specified multiple times
-include-path path include entry prefix PATH; this option can be specified multiple times
-exclude-path path exclude entry prefix PATH; this option can be specified multiple times
-exclude-name name exclude entry paths matching NAME (exact match of a path component); this option can be specified multiple times
-include-type <types> include entries matching <types> and exclude all other types
-exclude-type <types> exclude entries matching <types> and include all other types
default is to include all entry types
-include-field <fields> exclude <fields> from archive entries; this option can be specified multiple times
-exclude-field <fields> include <fields> from archive entries; this option can be specified multiple times
'archive': typ,pat,lnk,dev are always included; default is to include typ,pat,lnk,dev,uid,gid,mod,flg,mtm,dat,duz
'convert': typ,pat are always included; default is to include typ,pat,lnk,dev,uid,gid,mod,flg,mtm,dat,xat,acl,duz
'list': default is to include all fields
-manifest alias for the following options:
-exclude-field dat
-include-field sh1,cks,siz
-a lzfse -b 1m
-index alias for the following options:
-exclude-field all
-include-field idx
-a lzfse -b 1m
Special option values:
<fields> comma separated list of fields, from the following list:
typ type
pat entry path
lnk link path
dev device id
uid user id
gid group id
mod access mode
flg flags
mtm modification time
dat file data
siz file size
cks file data POSIX 1003.2-1992 32 bit CRC
sh1 file data SHA1 digest
sh2 file data SHA256 digest
xat extended attributes
acl access control list
duz file disk usage
idx entry index in input archive
yaf stored fields (metadata entry)
attr alias for uid,gid,mod,flg,mtm fields
all alias for all fields
<types> one or more characters representing entry types, from the following list:
b block special
c character special
d directory
f regular file
h hard link
l symbolic link
m metadata entry (not a filesystem object)
p fifo
s socket
<algorithm> compression algorithm, from the following list:
lzma LZMA preset 6 (xz)
lzfse LZFSE
lz4 raw LZ4 default level
raw no compression
zlib raw ZLIB level 5
lzvn LZVN
<size> size in bytes, optional suffixes b,k,m,g are accepted