Giter Site home page Giter Site logo

aspiesoft / docker-xz2gz Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 7 KB

Convert all `tar.xz` files in a specified directory to `tar.gz` through a docker container acting as a virtual machine.

Home Page: https://hub.docker.com/repository/docker/aspiesoft/xz2gz/general

License: MIT License

Dockerfile 5.30% Shell 94.70%

docker-xz2gz's Introduction

XZ to GZ

Convert all tar.xz files in a specified directory to tar.gz through a docker container acting as a virtual machine.

DockerHub

Usage

docker run -v <My Input Directory>:/input aspiesoft/xz2gz:latest

# example
docker run -v ./dir:/input aspiesoft/xz2gz:latest

How To Handle Output (Optional)

docker run -v <My Input Directory>:/input -e XZMODE="<Choose Method>" aspiesoft/xz2gz:latest

# example
docker run -v ./dir:/input -e XZMODE="remove" aspiesoft/xz2gz:latest

XZMODE Methods

  • remove: (default) removes <file>.tar.xz after successfully creating <file>.tar.gz
  • keep: keeps <file>.tar.xz without touching it
  • rename: removes <file>.tar.xz, then renames <file>.tar.gz to <file>.tar.xz
  • link: removes <file>.tar.xz, then creates a symlink to <file>.tar.gz named <file>.tar.xz
  • rename-link: removes <file>.tar.xz, then renames <file>.tar.gz to <file>.tar.xz, then creates a symlink to <file>.tar.xz named <file>.tar.gz

Why rename a .tar.gz file to .tar.xz?

For the tar command in linux, it is considered a best practice to use tar -xf and not tar -xJf or tar -xzf. This means it is more common not to specify a compression algorithm when decompressing archives, and to instead let the tar command handle it. The tar command in linux does not care what the file extension is, and actually reads the headers of the file to determine whether it is .xz or .gz that should be used for decompression.

If you need to convert a .tar.xz file to .tar.gz, and cannot change a program to look for .gz instead of .xz, if that program happens to follow the linux best practice, then we can force the .tar.gz file to be compatible, by renaming it to .tar.xz. It will still use the .gz algorithm, but the program will still find its expected .xz file.

Note: If a specific program does not follow the linux best practice, and chose to specify a decompression algorithm like tar -xJf, then the program may run into errors.

docker-xz2gz's People

Contributors

aspiesoft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.