Questions tagged [tar]

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

171 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
5 votes
0 answers
313 views

Tar - Transform stdin without extracting

I am attempting to transform the paths of a tar file coming from standard input without having to extract the tar first. This is an apparent duplicate of this question, I am looking for a solution ...
Joseph K. Strauss's user avatar
5 votes
1 answer
2k views

How to display progress bar for tar incremental archives?

While creating a level-0 archive I can do this: tar -cf - . | pv -s $(du -sb . | awk '{print $1}') | gzip > out.tgz But in case of a level-1 (incremental) archive, I don't know beforehand what ...
Priv5000's user avatar
4 votes
1 answer
629 views

GNU `tar` runs `stat` on an excluded directory. Is it normal?

I'm running tar as root like this: cd / tar --create \ --verify \ --exclude-backups \ --exclude-caches \ --auto-compress ...
Eleno's user avatar
  • 1,849
3 votes
1 answer
376 views

Tar: Exclude folders that have a dynamic name (using wildcard)

I have a backup routine that runs for Wordpress sites. There are folders created which are dynamic per installation of Wordpress. I cannot, for the life of me, figure out how to exclude the dynamic ...
BrianJM's user avatar
  • 131
3 votes
1 answer
714 views

MBR and bootstrap explanation for different size disk copy

I wish to clone a 500gb MBR source disk to a 250gb MBR destination disk manually by making each corresponding partition on the destination disk and restoring just the data contents of each. This way, ...
ron's user avatar
  • 6,545
3 votes
0 answers
1k views

How to mount a gpg-encrypted tar archive file?

On my laptop I actually have a folder where I store personal data which I don't want to share: private_folder ├── baz │   └── secret_file_3 └── foo └── bar ├── secret_file_1 └── ...
yolenoyer's user avatar
  • 499
3 votes
0 answers
911 views

debootstrap terminates partway through with "stdin: not in compressed format"

I'm on an Arch GNU/Linux system, fully up-to-date (both official repositories and from the AUR). I'm attempting to install a copy of Debian Wheezy so that I can chroot into it and work with the system....
strugee's user avatar
  • 14.9k
3 votes
1 answer
829 views

broken pipe when tar extracted from stdin buffer

I am restoring files from a tar archive on an LTO-7 tape to a locally mounted network share. If I directly restore to the share it runs very slowly (90 MB/s). When I use an additional buffer I get the ...
swami's user avatar
  • 205
2 votes
0 answers
154 views

POSIX compatible TAR for AIX and Solaris

I have created a TAR archive with our product using maven-assembly-plugin. The TAR archive is in the POSIX format. Our QA complains about PaxHeaders.X files when extracted. Do the AIX (version AIX 7.1 ...
wilx's user avatar
  • 598
2 votes
0 answers
1k views

Does the tar format support checksums?

TLDR, my main questions: Does the tar format itself support checksums? How to create a tar (or even better, tar.gz file) with the tar format built-in checksum? Long: Before you ask why I am asking or ...
adrelanos's user avatar
  • 1,836
2 votes
0 answers
702 views

Extract multiple tar files to their own directory on tar version 1.26

I am trying to extract multiple tar files by creating a directory of the same name as tar file. I am using centos with tar version 1.26 and unfortunately can't update the tar version to 1.29 or above ...
Pankaj's user avatar
  • 21
2 votes
1 answer
495 views

change directory based on file shell script

Firstly come background I am trying to write an executable shell script I can easily map as the default for .tgz files to auto-extract. so far so simple tar -xzvf $1 which works to drag/drop but not ...
MANICX100's user avatar
  • 199
2 votes
0 answers
1k views

How does the tar flag --totals interact with the -z flag?

-z, --gzip filter the archive through gzip --totals[=SIGNAL] print total bytes after processing the archive; with an argument - print total bytes when this SIGNAL is delivered; Allowed ...
lucidbrot's user avatar
  • 197
2 votes
1 answer
508 views

Can I create a tape backup that uses Microsoft Tape Format (MTF) on Linux?

Outside of LTFS, the Microsoft Tape Format seems to be the closest to a widely supported format when it comes to older tape format that don't support LTFS (In my case, Ultrium 3 and 4). However, ...
Michael Stum's user avatar
2 votes
0 answers
661 views

tar restore --listed-incremental timestamp is in the future

I have some backups that were created using tar --listed-incremental features. When I restore the individual backups one after the other using tar -xf archive.tar I get no warnings but if I restore ...
atapaka's user avatar
  • 541
2 votes
0 answers
1k views

Question about blocks sizes on Tape vs. Tar

I have an HP LTO-4 drive that I've been using for backups for a while now and everything works very well, but I have a question on how the Tar blocking factor works and what is actually written to ...
bcHelix's user avatar
  • 75
2 votes
0 answers
333 views

Performance of tar in a jfs2 with many small files

Observing the output of the tar command (-v flag) - observation by human eye - it seems to be pretty slower when it runs inside a sub-directory with about four hundred thousand small files (400000), ...
Luciano's user avatar
  • 1,159
2 votes
0 answers
2k views

Keep metadata or edit metadata with tar

I have a tarball. This tarball contains—of course—various files and directories. When I extract the tar, some of these files already exist, while others don't. What I would like to know is this: how ...
Letokteren's user avatar
2 votes
0 answers
512 views

How to extract and stitch together a multipart tar arcvhive without the initial file

I have a large folder with multi part tar files each 2gb in size, file.partaa through file.partgy, however I am missing the initial tar file. Is there any way that I can extract each part ...
cjmaria's user avatar
  • 253
2 votes
1 answer
136 views

Is it possible to create a compressed tape archive of a folder, from another directory location?

I want to create a compressed tape archive of a folder in a directory (we'll call it A) that I have put model output into. I want to be able to also move this .tar.gz file to another directory (we'll ...
Ali Koleiny's user avatar
2 votes
0 answers
1k views

Make bootable disk from tar archive

I have a compressed tar archive from a SLES 11 root directory. I'd like to boot another machine with a live linux, extract my OS archive on a disk, and make the disk bootable. Is there any easy way to ...
Vahid Noormofidi's user avatar
2 votes
0 answers
743 views

How to 'snapshot' a chroot?

I want to perform something similar to a 'clone' on vmware fusion/virtualbox/a VM manager. Host and chroot are both ubuntu. One complicating factor may be that this chroot may have one or more child ...
tarabyte's user avatar
  • 4,286
2 votes
0 answers
286 views

Backup using find and ssh to off-site server

I'm sure this has been been answered in bits and pieces on many sites, but somehow I can't seem to get this (as a whole) to work reliably. Scenario: I have a server that I would like to do ...
Sisu's user avatar
  • 29
2 votes
2 answers
2k views

curl progress in dialog

how can i properly display the curl progress in the dialog window? curl http://mysite.corp/image/root_21.tar.bz2 | tar -C /mnt/dest/ -jxf - i tried this command but as you can see it does not ...
Asaf Magen's user avatar
2 votes
0 answers
1k views

Using tar to backup and restore a path mounted with overlayfs

I have a system running OpenWRT with Linux 2.6.39.2. In my filesystem, I have symlinks contained in /etc/rc.d on ROM and more symlinks contained in /overlay/etc/rc.d in flash. overlayfs does a union ...
gsimard's user avatar
  • 121
2 votes
1 answer
250 views

Remove tar compress spool from cron email

I have a crontab job that call a simple script to backup a website: 15 0 1,10,20 * * /home/username/bin/backup_whatever This is the script: #!/bin/bash TODAY=$(date +"%Y%m%d") FILE_TO_PUT="filename....
jherran's user avatar
  • 3,939
2 votes
0 answers
295 views

Corrupt files after extracting with Cygwin's GNU tar

I have a bunch of tarball backups which I just restored onto my new Windows 8.1 + Cygwin system using GNU tar: zsh$ for file in **/*.tgz; do tar xvzf $file; done To my surprise a lot of these ...
Mark Boulder's user avatar
2 votes
0 answers
2k views

How to fix the corruption of the tar balls?

I was making a complete server backup and tried making the tar balls of each directory structure by using the following commands: nohup tar -cvf - /etc | gzip -9 -c > /opt/Backup_4_Jan/etc.tgz &...
Ankit Vashistha's user avatar
2 votes
1 answer
204 views

Tar using progress bar and handling multi-volumes

I'm trying to create a tar of a large LVM volume onto multiple external drives. That part is solved. Now, because it is a LONG process, I'd like a progress bar. From the excellent articles here, I'...
Glen Kauffman's user avatar
1 vote
2 answers
113 views

Looking for a tool that creates plain text tarball from set of files, they can be mailed in email body

I'm looking for a command line tool that takes a tarball, uncompresses and unpacks it, and turns the contents into one contiguous file, comprised of lines that are a maximum of eighty characters wide, ...
Joselin Jocklingson's user avatar
1 vote
0 answers
55 views

gtar recursively untar but leave in top directory

I am trying to recursively untar a whole lot of directories that have .tar files in them, but without creating any new subdirectories. I am successfully able to do one at a time with this command gtar ...
bk_32's user avatar
  • 111
1 vote
0 answers
70 views

Why doesn't doas wget -qO- archive.tar.gz|doas tar -xz work as with sudo?

sudo wget -qO- https://go.dev/dl/go1.20.1.linux-amd64.tar.gz|sudo tar -xz works fine. doas wget -qO- https://go.dev/dl/go1.20.1.linux-amd64.tar.gz|doas tar -xz does not work. I get no input, it just ...
John Smith's user avatar
1 vote
1 answer
346 views

Cheating tar out of "Cannot change mode to rwxrwxrwx: No such file or directory"?

I'm trying to build GCC 10, and in the end, I get a failure in make install (I'm trying to run sudo checkinstall -D --install=no --fstrans=no instead of make install, though, so I can build a .deb ...
sdbbs's user avatar
  • 480
1 vote
0 answers
80 views

How to extract subdirectory from tar into another tar without `sudo`?

Given A tar file with rootfs where all permissions and ownerships are set. Expected A tar file with content of subdirectory, let's say usr/local/lib where permissions and ownerships are retained. ...
Michał F's user avatar
  • 281
1 vote
0 answers
420 views

tar not working with sudo

I am trying to extract a file into /usr/local/ using $ sudo tar -xvzf /home/vyom/Downloads/go1.19.4.linux-amd64.tar.gz -C /usr/local/ tar (child): gzip: Cannot exec: No such file or directory tar (...
VIAGC's user avatar
  • 133
1 vote
0 answers
398 views

Extract a list of files from tape with tar

My goal is to extract only the files in a list from an lto5 tape using tar. The data was originally written to the tape using tar as well. I am able to accomplish this task from a .tgz file by doing: ...
kevin41's user avatar
  • 123
1 vote
0 answers
67 views

Why did my tar backup fail?

My home directory is encrypted with ecryptfs. I wanted to try some things that required reinstalling my system, so I backed up to a flash drive with this command: sudo tar cf backup.tar.zstd --one-...
Daffy's user avatar
  • 405
1 vote
0 answers
1k views

How to suppress warning messages in tar (GNU tar) 1.15.1?

On trying to tar files that are getting changed, I am receiving this message - tar: file changed as we read it. I am trying to suppress this warning message like this - tar --warning=no-file-changed -...
MVKXXX's user avatar
  • 121
1 vote
0 answers
98 views

GNU tar: How to mix include and exclude on when --listed-incremental is in effect?

I have a tar command where I need to mix "include" and "exclude" operations. This is - when not using --listed-incremental working perfectly, but not when combined with --listed-...
AnoE's user avatar
  • 575
1 vote
0 answers
263 views

Alternatives to compressed tarballs

I am reading/writing data from/to tapes using Debian and recently ran into an issue where I needed to figure out the size of the stored data stream, i.e. the data actually written to the tape (see ...
leetbacoon's user avatar
1 vote
0 answers
393 views

Extracting a symlink-containing tarball on git bash

I wanted to extract a compiler's tarball on git bash on Windows 10: $ tar xzf polyml-5.8.2.tar.gz tar: polyml-5.8.2/compile: Cannot create symlink to ‘/usr/share/automake-1.16/compile’: No such file ...
Gergely's user avatar
  • 814
1 vote
0 answers
169 views

ssh_host_[algorithm]_key group owner changed after OS restoration

I've this weird problem which I can't find an answer. Recently I restored a linux machine (RHEL 7.3) from the OS tar archives. Steps taken are as below: Create OS related filesystems tar archives, ...
bongsf's user avatar
  • 11
1 vote
0 answers
755 views

TAR returns 1 on big directories - how to ignore this?

I'm running the following sequence for backup purposes: $> set -o pipefail $> tar -c /vary/large/folder1 /very/large/folder2 | xz ... | gpg ... | aws ... $> echo "${PIPESTATUS[0]} ${...
manifestor's user avatar
  • 2,463
1 vote
0 answers
600 views

How to tar-gzip a directory and put it in the /tmp

Hey im stuck on a assignment and i dont know how to solve it really because iam quite new with working in linux. I have to place a directory in a tar-ball and zip it using gzip. At the moment this is ...
Nasrat Salehi's user avatar
1 vote
0 answers
118 views

TAR command produces 0kb file after completing

In linux i have this code: touch –t 202108010101 some_file find . -newer some_file -print0 | xargs -0 tar cfz //mnt/wss/anva-abs-from-01-08.tar Wich produces an tar file for everything earlier than ...
user488792's user avatar
1 vote
0 answers
501 views

Checksum or validate .tar file contents with directory in shell

Scenario: Using Linux shell to back up a directory of many sub files and compressing the data with ‘tar -cvpJf filename.tar /savedir/’. Goal: Using shell — checksum or validate the newly created ‘.tar’...
CosmicFiasco's user avatar
1 vote
0 answers
110 views

bash script to lazy tar to fifo as files arrive

Here's the hypothetical scenario: I have an archival process where files are showing up and I append them to tar, and then the tar gets zipped. Something like this: while sleep 1 ; do new_files=&...
galets's user avatar
  • 1,177
1 vote
1 answer
304 views

Modify the data type from .tar file and how to recover a corrupted one

Like the original question bellow, I need to recover a corrupted tar file. But after run: file file.tgz I got this return: file.tgz: data My question is about this return above and how to change ...
TheMushroomBlue's user avatar
1 vote
0 answers
122 views

Tar archive overwrote original file

I was compressing a rosbag file using tar when I mistakenly used the same original file name for the the archive name and had it overwritten by the output archive , the compressed archive size is very ...
Amr's user avatar
  • 11
1 vote
1 answer
133 views

tar local folder and transfer sensitive data to remote machine vs rsync

I need to backup some important data from local folder and transfer it to remote machine - worker01 so I think to tar the local folder and send the tar to remote machine as the following tar zcvf - /...
yael's user avatar
  • 13.1k