Questions tagged [tar]

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

Filter by
Sorted by
Tagged with
1
vote
2answers
55 views

List all files present in backup2.tar.bz2 but not present in backup1.tar.bz2

This lists all files in two backups, sorted by size: tar tvf backup1.tar.bz2 |sort -k3 -n >backup1_files.txt tar tvf backup2.tar.bz2 |sort -k3 -n >backup2_files.txt I'd like to list all files ...
-1
votes
1answer
51 views

Any advantage in TAR's built-in archive support?

Given the option to call: tar -cI "xz -9" -f my_archive.tar.xz my_path/ and XZ_OPT=-9 tar cJf my_archive.tar.xz my_path/ The result of both is exactly the same size. Is there a good reason to ...
1
vote
1answer
58 views

How to remove compressed files while extracting an archive?

I need to unpack a big archive, but the problem is i don't have enough disc space for both compressed and extracted files. Is there option to delete compressed files from the archive right after ...
1
vote
0answers
111 views

Problem when piping stdin to tar

I need to write data (multiple files and directories) from a Google cloud storage bucket onto a Tar archive on my local disk. The directories are multiple TB, so I do not want to create the Tar ...
0
votes
3answers
2k views

Cannot change ownership to uid 1001, gid 1001: Invalid argument

I'm installing ONOS and following this guide: https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start I executed the command sudo bazel build onos This will compile and assemble the ...
1
vote
2answers
95 views

Tar create archive rename root dir

I'm trying to create tar archive and rename root dir in archive. E.g. I have these files: $ tree ./repo ./repo ├── 1 ├── 2 └── 3 0 directories, 3 files I want to create an archive repo-v1.0.0.tar.gz ...
0
votes
0answers
141 views

corrupt tar.gz archive

I'm new here and I want to ask something maybe you can help me. I wanted to service my NAS and I had to download all the data that I had on it, so what I did is downloaded whole data trough webbrowser ...
1
vote
0answers
257 views

Tar.gz with specific sizes but compressed files contains zero bytes

Recently I took backup of certain folders by compressing them using tar.gz. I checked the file sizes and they looked like with specific sizes so I assumed that the files that got compressed must be in ...
10
votes
2answers
798 views

What is the easiest way to list all the user:group found in a tarball?

I'm installing some of my data from my old server to my new server. Since I had my old server for ages, I have a huge amount of legacy data with, most certainly, legacy user and group names. When ...
0
votes
0answers
48 views

Does archiving root directory archive additional mounted disk directories?

I am trying to archive a bunch of systems using tar. In order to do so, I am planning to run tar on each of the devices listed by df command's output (except tmpfs). Since the non-root devices are ...
1
vote
0answers
32 views

How to re-archive Android backup tarball properly

I have this peculiar situation where unpacking and repacking an Android backup tarball changes the entries in it, resulting in the backup file being unusable. To make things simpler for the reader, ...
1
vote
3answers
15k views

How to overcome tar: Removing leading `/' from member names [duplicate]

My command is totally different when you compare with that command I am trying to run below command in linux Command: tar zcvf ABCD.tar.gz -T Files.txt and i am getting an error message as Error:...
1
vote
1answer
204 views

List contents of a tgz archive inside a gz archive

Bit of a weird one - I've got a honeypot running dionaea, which is a tool that consolidates any binaries that were uploaded to the device in single location (/data/dionaea/binaries). However, every ...
0
votes
1answer
95 views

tar - List of extracted files

How can I extract files from a .tar.gz archive while keeping a trace of the extracted files? For example, let's say I have the following file structure... ROOT ╠═▶ children ║ ╠═▶ joe.txt ║ ╚...
0
votes
1answer
71 views

Using tar to update archive with files from a while loop?

I have the problem listed here: Oct 2019 upgrade: pip upgrade failure · Issue #5844 · msys2/MINGW-packages: basically, pip on MSYS2 refuses to update because it sees some files. pacman -Syu basically ...
2
votes
2answers
826 views

How to repeatedly un tar files that are within the tar itself

I have a tar file that has been tar-ed many times. It follows a similar structure like this: 1000.tar | --- filler.txt (random text) 999.tar | --- filler.txt ...
0
votes
1answer
689 views

tell tar to ignore sockets - I don't want to see warnings

I have this warning message about sockets with tar: ERRO[0000] Can't add file /home/ubuntu/backup-db/.bunion.sock to tar: archive/tar: sockets not supported how can I tell tar that I don't ...
1
vote
0answers
359 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 └── ...
1
vote
0answers
31 views

How to tar a file that is opened and under concurrent writes by another process?

For example, while an application continuously writes text lines to a file named ./data.csv, i ran the following tar command: tar cvfz /tmp/1.tgz ./data.csv Though tar did create the tar ball /tmp/1....
0
votes
1answer
74 views

how to conditionally run different command with same arguments

if gtar is defined I want to use that, instead of tar: if command -v gtar; then gtar --exclude-ignore='.deployignore' -cf /dev/stdout . | aws s3 cp - "$arti_fact" else tar --exclude-ignore='....
1
vote
1answer
74 views

Zip and archive to other directory

I have some 250 CSV source files in the incoming directory. My task is to merge those CSV files and generate a file like Merge_. the Informatica Job will then pick the merge file as the source and ...
1
vote
3answers
239 views

Difference between .bz2 and .tar.bz2 files

I am supposed to find whether a file is compressed using .bz2 or .tar.bz2(without using extension of file) and and decompress it accordingly. I used the file command but it is giving same result for ...
0
votes
0answers
27 views

compressing folders with tar and trying to exclude a folder

I'm trying to get a small script to run smoothly, it's supposed to archive all subfolders under /docker/*. What I wan't is the script to exclude all folders that has a date (i e 20191010, 20180502 and ...
1
vote
0answers
110 views

How to force tar cf to have reproducable results?

Preface: We have a complex build process and discovered it's working on one system and failing on another (unfortunally/Murphy it worked on the Jenkins build server, so the problem remained ...
0
votes
2answers
131 views

How could I untar many tar files seperately with one command?

I have many tar files like this: aa.tar, bb.tar, cc.tar, .... I would like to untar them to their own directories such as aa/, bb/, cc/ ... I tried this: ls | xargs -n1 -I {} tar -xvf {} -C `...
0
votes
1answer
217 views

tar - file not found in tarball even though it is there

What I want to do I just want to extract a backup version of a file for analysis, /etc/net.cfg, which is in a tar. What happens when I try It fails, like so... # tar -tf mytar.tar | grep net.cfg /...
1
vote
1answer
2k views

Unable to Untar or Unzip from SFTP connection

I am able to zip and transfer files using SFTP with the below commands from my script: zipfilename="Order_$(date +"%Y%m%d%H%M%S").zip" echo "Start Execution" $(date +"%Y%m%d%H%M%S") >> "$...
0
votes
1answer
34 views

Zip a folder while copying it

Is it possible to zip a folder while copying it? I want to copy a folder and then zip it, but this implies that I need for a while twice the space in my /mnt path, right? /bin/cp -r /mnt/myfolder /...
1
vote
2answers
118 views

How to rename top folder in tarball while extracting?

If I have a tar.gz archive containing a single folder named like <somename>-<somenumber>, how do I extract it so it unpacks into a folder called <somename>? For example, the file ...
0
votes
0answers
120 views

autocomplete with tar and .xz

When I wish to unpack a certain file with tar, I type tar followed by my chosen parameters. Then I type the first(s) letter of the file name and then press the tab key, as to let the autocomplete ...
2
votes
1answer
222 views

Docker busybox tar broken pipe

When executing docker run --rm -v ldaps_ldap-config:/volume -v /tmp/tmp.VznAcI3PTA:/backup busybox tar c -Jvf /backup/ldap-config.tar /volume I always get the following output: BusyBox v1.31.0 (...
2
votes
2answers
810 views

GNU tar not ignoring directories in gitignore with --exclude-vcs-ignores

I have a git repo: rsh: ❯ cat rsh/.gitignore *.o shell build/ rsh_history And I'm attempting to tar it up using tar (GNU tar) 1.32. The command I'm using is: ❯ gtar cvaf rsh.tar.gz --exclude-vcs-...
-2
votes
1answer
77 views

tar flexibility for -f

In the following command for example, tar -xzv works but tar -xzvf fails: wget ${target_url} -O - | tar -xzv --strip-components 1 -C ${web_application_root}/${domain} I understand I download a data ...
0
votes
3answers
2k views

Piping of stream from wget to tar, and extracting it to a specific location failed

I try to pipe a stream from wget to tar and extracting it to a specific location. The file is downloaded by wget but not extracted as desired with tar: war="/var/www/html" domain="example.com" ...
-2
votes
1answer
188 views

Difference between GNU tar's --transform and --xform options

What is the main difference between GNU tar --transform to --xform? From reading the GNU tar manual, I assume they might be the same and the latter is a "sugar syntax".
-1
votes
2answers
190 views

Non recursive tar listing

I have a tar archive file containing a directory with lots of files and I desire to list just that directory without extracting it (to hastenly know that directory's filename). I executed: tar -tf ...
-2
votes
1answer
430 views

How to join tar files after splitting when we want to join specific files

We have the following combination of binaries files (they are after splitting) HADOOPa HADDOPb HADOOPc HADDOPd HADOOPe HADDOPf HADOOPab HADOOPac HADOOPbc Now we want to join them to tar. Since we ...
0
votes
3answers
198 views

Automatically hold directory name from inside a tar, by a variable

I download a tarball containing only one directory; this directory has a very long name. I desire to change that directory's name once I extract it from the tarball but I prefer another way than ...
3
votes
2answers
780 views

Failing to untar

I am dealing with transferring large files from one machine to another (600GB+) and I'm tarring them up using tar -cpvzf file.tar.gz -C PATH_TO_DIR DIR Once finished with the tarring process, the ...
14
votes
4answers
24k views

What does --strip-components -C mean in tar?

I want to make sure I understand the following code: tar xvzf FILE --exclude-from=exclude.me --strip-components 1 -C DESTINATION which was posted in this answer. From man tar: --strip-components=...
1
vote
1answer
905 views

How can I extract files with specific extension from a tar file's root directory?

I have a tar file. That's what its structure looks like: -images.tar.gz -folder_0_image_1.jpg -folder_0_image_2.jpg -folder_0_image_3.png -... -folder_1 -folder_1_image_1.jpg ...
1
vote
2answers
207 views

Download-extract all content of a directory in tarball into an existing directory to override everything besides one or more exceptions

I have a MediaWiki 1.32.0 website which I want to upgrade, hosted on a CentOS "Shared Server" environment. It is an all-core website with no added extensions, skins and images (besides logo) To ...
2
votes
0answers
154 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, ...
0
votes
1answer
321 views

Is there a backup utility to backup to LTO tape that's not TAR, PAX, or CPIO?

I'm using Solaris 11.3 and wish to occasionally backup a bunch of large VM's and disk images directly to a used LTO6 tape drive bought off Ebay but even though Solaris TAR has the "E" flag to allow ...
0
votes
1answer
219 views

Centos 7 minimal, installing tmux app manager and fluxbox styles

I'm having difficulty installing things like tmux app manager and fluxbox styles. In both cases i attempt to tar into their directories ~/.tmux/plugins/tpm & ~/.fluxbox/styles like this sudo tar ...
1
vote
2answers
682 views

tar contents in current directory to stdout

I am trying to tar the current directory and stream to stdout (ultimately to Amazon S3)...I have this command: tar -cf - . but I get this error: tar: Refusing to write archive contents to ...
1
vote
1answer
175 views

How do I pass arguments to lzip through tar?

I want to run tar --lzip -cvf file1.txt file2.txt. But lzip's help page states that by default it does not run at its fullest compression power (the option for which is -9, while the default is -6). I ...
0
votes
3answers
378 views

Compress a large folder tree while keeping an easy way to navigate and extract particular files

I have a large and heavy folder tree with many files and folders. I want to compress it to reduce the storage size. This tree will not be frequently used any more, but quite probably I will need to ...
0
votes
2answers
445 views

correct order while combining different options of a command

I usually combine options together whenever there are more than one option to be used with respect to some command. For example , if i want to create an archive using tar i will write tar -cvf archive....
7
votes
8answers
2k views

How to tar a list of directories only if they exist

I have a list of directories that I want to archive. But sometimes they do not all exist. I want to be able to create an archive by providing a list of directories, and it will only archive the ...

1 2 3
4
5
22