Skip to content

Update tar command to remove absolute paths from the archive

ryanlong requested to merge tar_absolute_paths into main

Created by: deepakduggirala

Description

Current command create tar files with full path of the directory. Ex:

running the command tar cf /N/scratch/bioloop/foo.tar --sparse /N/project/bioloop/raw_data/test_dataset produces a foo.tar when extracted

tar xf foo.tar produces the below hierarchy in the directory where it was extracted.

  • N/
    • project/
      • bioloop/
        • raw_data/
          • test_dataset/
            • ... files/dirs of the dataset

tar cf /N/scratch/bioloop/foo.tar --sparse -C /N/project/bioloop/raw_data/test_dataset . removes absolute paths from the archive and when extracted just produces:

`tar xf foo.tar

  • foo/
    • ... files/dirs of the dataset

Merge request reports

Loading