Skip to content

Instantly share code, notes, and snippets.

@ntrepid8
Last active July 4, 2024 09:26

Revisions

  1. ntrepid8 revised this gist Dec 2, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tar_xz_tips.md
    Original file line number Diff line number Diff line change
    @@ -23,3 +23,4 @@ sources:
    - https://matoski.com/article/xz-compress-directory/
    - https://tukaani.org/xz/
    - https://www.digitalocean.com/community/tutorials/an-introduction-to-file-compression-tools-on-linux-servers
    - https://www.rootusers.com/gzip-vs-bzip2-vs-xz-performance-comparison/
  2. ntrepid8 revised this gist Dec 2, 2017. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions tar_xz_tips.md
    Original file line number Diff line number Diff line change
    @@ -22,3 +22,4 @@ sources:
    - https://superuser.com/questions/168749/is-there-a-way-to-see-any-tar-progress-per-file
    - https://matoski.com/article/xz-compress-directory/
    - https://tukaani.org/xz/
    - https://www.digitalocean.com/community/tutorials/an-introduction-to-file-compression-tools-on-linux-servers
  3. ntrepid8 created this gist Dec 2, 2017.
    24 changes: 24 additions & 0 deletions tar_xz_tips.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    # tar xz tips

    Compress a directory using multiple threads and show a progress bar with this script:

    ```
    #!/usr/bin/env bash
    # example: tar_cJf.sh ./directory > directory.tar.xz
    SOURCE="$1"
    # get source size
    SOURCE_SIZE=$(du -sk "${SOURCE}" | cut -f1)
    # archive and compress
    tar -cf - "${SOURCE}" | pv -p -s "${SOURCE_SIZE}k" | xz -6 --threads=6 -c -
    ```

    sources:

    - https://superuser.com/questions/168749/is-there-a-way-to-see-any-tar-progress-per-file
    - https://matoski.com/article/xz-compress-directory/
    - https://tukaani.org/xz/