5/6/2023 0 Comments Nucore.tar.gz pinbox![]() In this case -9 is the compression level and -p 4 is the number of cores dedicated to compression. uses everyfiles that find found previously Step 3: pigz cf - tells tar to use the tarball name we'll specify later Leading '/' with be removed by -transform anyway. P tells tar to use absolute paths, so it doesn't trigger the warning "Removing leading `/' from member names". Note that you can't use -C option to change directory as you'll lose benefits of find: all files of the directory would be included. It will strip the path of the files from the archive so the tarball's root becomes the current directory when extracting. transform is a simple string replacement parameter. exec will execute the next command using the results of find: tar Step 2: tar Add as many -o -name "pattern" as you want. This command will look for the files you want to archive, in this case /my/path/*.sql and /my/path/*.log. If you want to have more flexibility with filenames and compression options, you can use: find /my/path/ -type f -name "*.sql" -o -name "*.log" -exec \įind /my/path/ -type f -name "*.sql" -o -name "*.log" -exec z, -gzip, -gunzip, -ungzip filter the archive through pigz j, -bzip2 filter the archive through lbzip2 If you build tar from sources, then you can recompile with parameters -with-gzip=pigzĪfter recompiling tar with these options you can check the output of tar's help: $ tar -help | grep "lbzip2\|plzip\|pigz" All files compressed in multi-threaded mode meet thisĬondition, but files compressed in single-threaded mode don't even if On files that contain multiple blocks with size information inīlock headers. Threaded decompression hasn't been implemented yet. However this will not work for decompression of files that haven't alsoīeen compressed with threading enabled. Multithreaded compression and decompression are not implemented yet, so this This is a fragment of man for 5.1.0alpha version: If you are running version 5.2.0 or above of XZ Utils, you can utilize multiple cores for compression by setting -T or -threads to an appropriate value via the environmental variable XZ_DEFAULTS (e.g. $ tar -I 7zhelper.sh -xf OUTPUT_FILE.tar.7z Here the example of usage: $ tar -I 7zhelper.sh -cf OUTPUT_FILE.tar.7z paths_to_archive p7zipįor p7zip for compression you need a small shell script like the following: #!/bin/sh You can compress using multithread version and decompress using singlethread version and vice versa. ![]() Input and output of singlethread and multithread are compatible. $ tar cf - paths_to_archive | pigz > OUTPUT_ If your replacement utility hasn't this parameter and/or you need specify additional parameters, then use pipes (add parameters if necessary): $ tar cf - paths_to_archive | pbzip2 > OUTPUT_ $ tar -use-compress-program=pigz -cf OUTPUT_ paths_to_archiveĪrchiver must accept -d. For instance: $ tar -I pbzip2 -cf OUTPUT_2 paths_to_archive Most popular multithread archivers are pigz (instead of gzip) and pbzip2 (instead of bzip2). You can use multithread version of archiver or compressor utility. There is option for tar program: -I, -use-compress-program PROG ![]()
0 Comments
Leave a Reply. |