>_ IzzyLab

Hands-on task

This task is step 8 of the course “Archives and backups”

Compress with xz

medium~5 min

Build an archive of the /root/logs directory using xz compression (stronger than gzip) into the file /root/logs.tar.xz. Then verify yourself: the content listing should be readable.

What you'll practise:
  • tar
  • xz
  • compression
  • archives

Topic breakdown

tar doesn't compress anything itself — it delegates that to external compressors, and each is selected by its own flag: gzip, bzip2, and xz all use different flags. The xz format gives denser compression at the cost of speed and is typically applied to logs and large text data. When reading such an archive, tar detects the compression from the content or you hint the same flag; the integrity of the xz container is separately checked with the xz utility.

What's checked

  1. valid xz archive
  2. content is present

What it looks like