The tar archive format and/or the command-line utility for working with tar files.

learn more… | top users | synonyms

2
votes
0answers
18 views

Recover corrupt tarball

I have a corrupt tarball on my hands. My first attempt at recovery went like this: $ tar --ignore-failed-read --ignore-command-error -xf tarball.tar tar: Skipping to next header tar: Archive contains ...
0
votes
2answers
13 views

Tar - exclude all files in sub folder but not nested folders

I need to create a .tgz archive of the following folder pack | rest | vendor (folder) | ----index.php | ----info.log | another (folder) | ---index.php ...
6
votes
3answers
325 views

Can tarring files improve compression?

Can tarring a bunch of files together improve compression with the standard tools, e.g. gzip, bzip2, xz? I've long thought this to be the case but never tested it out. If we have 2 copies of the same ...
1
vote
1answer
20 views

Performance of `tar -xf` (block size related)

I'm recently working on optimizing the performance of tar -xf, i.e. untar a file. I notice that under default settings, tar -xf calls writes to write 10 KiB output at a time in chunks. However, this ...
-1
votes
0answers
13 views

How to move a compressed tar from one remote server to another?

I have a .tar.gz file at remote server A. I want to copy this file to remote server B and uncompress it there. How can it be done? [you@localhost ~]$ scp examplefile ...
1
vote
0answers
21 views

untar error - Cannot change mode to rwxr-sr-x

I am trying to untar a .gz file , which is stored in the /root folder onto a directory in /mnt/flash2/example I use the following command - tar xzf filename.gz --no-same-owner -C /mnt/flash2/example ...
12
votes
8answers
3k views

Memory problems when compressing and transferring a large number of small files (1TB in total)

I have 5 million files which take up about 1TB of storage space. I need to transfer these files to a third party. What's the best way to do this? I have tried reducing the size using .tar.gz, but ...
3
votes
1answer
45 views

Are tars deduplicatable at the block level?

Quite simply, when a tar file is made on disk, would the extents be deduplicatable with extents inside and/or outside of the tar? I am asking in the theoretical sense, so if the extents of data are ...
3
votes
5answers
108 views

View a file in a tar archive without extracting it

I want to view the content of the tarred file without extracting it, Scenario: I have a.tar and inside there is a file called ./x/y.txt. I want to view the content of y.txt without actually ...
0
votes
0answers
27 views

I can fix/repair small damaged tar.gz files using fixgz but it doesn't work on bigger files

The title tells it. I have some damaged .tar.gz files, most of them are pretty small (smaller than 1-2gb) but 4 of them are bigger and fixgz cant fix them, when i run fixgz for those big files, it ...
0
votes
1answer
55 views

tar with -C not working [duplicate]

I am trying to un-tar into a different directory using this tar xvf BACKUP.tar -C test But I am getting the following errors File -C not present in the archive. File test not present in the ...
0
votes
1answer
44 views

tar exclude files *.zip

Why don't *.zip patterns work in tar : tar cfjv backup.tar.bz2 --exclude mydir/files/*.zip mydir Is there another syntax?
0
votes
1answer
51 views

Extract files from a corrupted .gz file

I tried to compress a directory using tar -zcvf output.gz input_dir. I suppose I should have used a .tgz extension for compressing. How do I untar output.gz? I tried both tar zxvf output.gz, which ...
3
votes
2answers
26 views

Including process output in tar file

I have a simple bash script to generate a compressed tar file and upload it to an external server for backup purposes. In addition to files on the server, I'd like to include dumps of a few mysql ...
1
vote
2answers
32 views

Pack installed system in tar.gz file

I have arch linux installed, with partition scheme like this: /dev/mapper/lvm-root -> / /dev/mapper/lvm-home -> /home /dev/mapper/lvm-opt -> /opt /dev/mapper/lvm-pkg -> ...
2
votes
3answers
38 views

tar compresses folder, but creates nested structure

I have the following folders on a linux machine ./myFolder ./tmp ./packages ./zips compress.sh I run tar -czf ./zips/someFile.tar.gz ./tmp/someFolder from compress.sh. The folder is ...
0
votes
2answers
61 views

how to untar file in linux red hat?

I am compiling linux red hat stable kernel on red hat linux and the error which I am facing is as below
1
vote
1answer
27 views

How to specify a common parent folder to tar files from different sources into

Here is the current command I'm running: tar --directory=/Users/joe/images -czvf images.tgz dir1/image1.jpg dir2/image2.jpg As you can see, this is using /Users/joe/images as the root directory, and ...
0
votes
1answer
14 views

How do I test for existence of a file(s) within a certain directory before making a Tar of that directory?

How do I test for existence of a file(s) within a certain directory before making a Tar of that directory? Would it possibly look like this: if [ -f /home/backup ]; then tar cf name.tar; fi
1
vote
1answer
42 views

How to transfer a rootfs folder?

I just created a rootfs with debootstrap in a Debian Jessie VirtualBox VM. Now I would like to transfer this to the host, by first compressing the directory to a tar archive, so I can upload it and ...
0
votes
0answers
33 views

Backup server with tar, encrypt and directly transfer the result, AFTER BUFFERING IT

So I've been investigative how to make full backups with tar, and I found that tar is a good tool if the backup is to be made once, and if the server has enough disk space to handle the output file. ...
0
votes
1answer
26 views

By convention, where do packages go to install on other machines?

I'm working on a script that will scp a tarball to another machine and extract and install it's contents via ssh. I have to install this script as one bash file and one tarball. I could install the ...
0
votes
1answer
120 views

Unarchiving a downloaded tarball with Ansible

I'm trying to get WordPress downloaded and installed via Ansible and I can't seem to figure out what I'm doing wrong here. First I download via the get_url module then I attempt to use the unarchive ...
1
vote
1answer
42 views

Copy a rolling “last 2 months” of files

I have a friend who is a photographer and she has a lot of large files as a result. Our current solution is where some files are delivered to my house. I don't have the storage capability to store all ...
0
votes
2answers
88 views

tgz file give invalid compressed data--format violated [closed]

I have download this file http://download.icu-project.org/files/icu4c/55.1/icu4c-55_1-HPUX11iv3-aCC.tgz https://ssl.icu-project.org/files/icu4c/55.1/icu4c-bin-55_1.md5 md5sum ok But on linux and ...
8
votes
3answers
604 views

How do I compress files in-place?

I have a machine with 90% hard-disk usage. I want to compress its 500+ log files into a smaller new file. However, the hard disk is too small to keep both the original files and the compressed ones. ...
1
vote
3answers
58 views

how to add files from a folder to archive instead of the folders itself

this is not a duplicate of creating a tar archive without including parent directory If I do tar -czf archive directory, directory will be added to the archive. I want to add the files of the folder ...
2
votes
3answers
147 views

tar unix not changing directory

I am executing a tar command to compress files which are present in another directory. I executed following command: tar -czf /backupmnt/abc.tar.gz -C /backupmnt/statusService/ * I want to create ...
1
vote
1answer
92 views

unpigz (and untar) to a specific directory

I know how to gunzip a file to a selected location. But when it comes to utilizing all CPU power, many consider pigz instead of gzip. So, the question is how do I unpigz (and untar) a *.tar.gz file ...
1
vote
1answer
58 views

Tar and download in one step over ssh / scp [duplicate]

(This seems like an obvious / common question, but I couldn't find it when searching - maybe I wasn't using the correct terminology...) I want to login over ssh to a remote machine, tar a directory, ...
1
vote
2answers
90 views

busybox tar or split large file to multiple smaller files

I am running Linux version 3.4.8 on an at91sam9g20. I want to take a large record and split it into multiple files. I have tried a number of methods, but none appear to function correctly, e.g. ...
3
votes
1answer
47 views

use tar to extract and immediately compress files from tarball

I have a compressed tarball (eg foo.tar.gz) that I wish to extract all the files from, but the files within the tarball are not compressed. That is to say, the contents of foo.tar.gz are ...
4
votes
4answers
391 views

tar extract into directory with same base name?

I have a ziped file like myArchive123.tar.gz. Inside it contains a folder like helloWorld If I extract it: tar -xf myArchive123.tar.gz I get the helloWorld folder: ls myArchive123.tar.gz helloWorld ...
2
votes
2answers
179 views

how to create multi tar archives for a huge folder

I have a large folder with 30M small files. I hope to backup the folder into 30 archives, each tar.gz file will have 1M files. The reason to split into multi archives is that to untar one single large ...
0
votes
1answer
39 views

make `tar` archive from NTFS with non-ascii file names

Loaded a live disk into a Windows based machine with NTFS files. Being a Linux user for some years, using tar came to my mind instantly and made some backup archives from partitions and stored them ...
3
votes
1answer
42 views

Why does tar hang with 100% CPU if files list has leading spaces

Tar hangs with 100 % CPU load if the --files-from <LISTFILE> option is used and the <LISTFILE> contains leading spaces. Why is that? To reproduce: Given two files file1 and file2 of ...
2
votes
3answers
51 views

Extracting archive by piping contents of archive into the tar command

I am creating a self-extracting archive and I have got the basic thing going. However I want to set the command that extracts the archive contents tail -n+$ARCHIVE_START_LINE $0 into a variable. I ...
4
votes
1answer
38 views

How to get tar to hardlink identical content on-the-fly during archive creation?

How can I get tar (or any other program that is commonly available on Linux, e.g. pax) to hardlink duplicate content on-the-fly during archive creation? That is, I'd like to avoid hardlinking upfront ...
0
votes
0answers
40 views

Tar corrupting file attributes and skipping directories

While creating tar archives for backup purposes with 'large' numbers of files (200+), I have been repeatedly running into the following errors: tar: some/path/file.xyz: Cannot stat: Invalid argument ...
-1
votes
1answer
59 views

Generate a tarball or (.tar.gz) of the recently modified files in the directory

As the title says, I need help creating a linux script that generates a tarball or (.tar.gz) of all the files in the directory passed in as an argument to the script and have been modified in the past ...
0
votes
2answers
51 views

Is it possible to list all files in a *.tar.gz file without scanning it's whole contents?

I know this way only: tar --full-time -tvf /path/to/file.tar.gz But it makes tar to scan all the archive and it is time consuming if it is a very big one. My question is maybe there is a way to ...
0
votes
1answer
26 views

How to archive files and not entire path

I'm trying to archive specific files on diferent folders. I use this bash command: tar cf file.tar /home/albertserres/Descargas/file Inside the .tar file i have a folder named home inside another ...
0
votes
0answers
81 views

shell script prompting for password but not taking it while doing tar

In my shell script, I have following lines: function tarIt() { FILE_OWNER=$1 TAR_FILE_NAME=$2 FILE_NAME=$3 su - $FILE_OWNER -c "tar -czf $TAR_FILE_NAME $FILE_NAME 2>&1" if [ ${?} ...
1
vote
2answers
121 views

How to tar, split, pipe, untar over ssh

I'm copying large files over LAN, and I've noticed that with doing one ssh pipe, I can get around 10MB/s transfer speed. However, if I shoot off four of those at the same time, I get around 40MB/s ...
0
votes
1answer
69 views

tar unused files then delete them

I have folder with subfolders and sessions logs. I need some commands or script to tar this folder without usage files and then delete it. I have this construction, but I'm not sure if this leave ...
3
votes
4answers
732 views

tar a result of wget

I want to wget a file and tar it, in one command, I guess it is simple but I can't get it done. I tried several things. wget <url> | tar -cvz file.gz.tar - tar -cvzf file.tar `wget ...
0
votes
1answer
185 views

TAR gives error - tar: You may not specify more than one `-Acdtrux' or `--test-label' option

I am trying to make a tar ball and its throwing the error, persis1@takwa228-DEV $ tar -pcrvzf ALPHA.tar.gz https-ALPHA tar: You may not specify more than one `-Acdtrux' or `--test-label' option Try ...
3
votes
2answers
48 views

Help checking the integrity of TAR files for backup

I want make a backup of my Home directory and I've read a good method is to use the tar tool, and I think it suits me well since all I need to do is create a .tar of every folder in the Home directory ...
1
vote
1answer
42 views

Extracting the Contents of tar archive to parent directory issue resulting in creation of sub directories

I have a Tar file: testwebsite.tar I've placed it in the directory I would like to extract its contents to on my Web server which is mytestdirectory I run this command via PuTTY: tar -xvf ...
3
votes
1answer
43 views

Can tar discover the archive format when piping it in via wget?

When I have a tar archive of any format, I can use: tar xf archive.tar.xz tar xf anotherarchive.tar.gz as tar discovers the relevant format by itself. Now I want to download the archives and ...