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

learn more… | top users | synonyms

2
votes
1answer
24 views

Does linux tar block write access to files

I have a large (>10GB) folder full of images on a live webserver that I need to back up and transfer. I'm worried that if I tar the folder, the files will be blocked for reading by the webserver, ...
-1
votes
0answers
17 views

posix_spawn taking too much time to spawn a new python program from c++ [on hold]

I'm facing a problem where when I invoke my python program from c++ using posix_spawn it takes around 70ms-200ms based on how long main program was running. Is there anyway I can reduce this time, as ...
0
votes
1answer
21 views

tar a whole subfolder and a single file from another subfolder, retaining directory structure?

Most q&a about tar either ask about grouping an entire directory into a tar, or single files matching a pattern (e.g. same extension), but I want to do a mix of both. That is, if I have this dir ...
2
votes
1answer
36 views

tar archive with certain unpacking order

In order to make the unpacking process as robust as possible I would like for a tar(.gz) archive to be unpacked in a certain order so that a power outage or such is less likely to cause harm. As an ...
0
votes
0answers
18 views

Unable to execute backup commands in a Virtual Tape Library

I have created a virtual tape library with mhVTL based on the steps given in this link. When i try to list the tapes with lsscsi -g that are mounted it showed. [0:0:0:0] disk ATA ...
2
votes
1answer
27 views

How to decrypt a file from an encrypted tar archive without decrypting the entire archive

similar question: Encrypting and compressing I want to make a regular backup and store it as encrypted tar archive. That's achievable using tar and gpg. But for incremental backups this would require ...
10
votes
5answers
34k views

How to create tar archive in a different directory?

I want to create a tar archive in a different directory rather than the current directory. I tried this command: tar czf file.tar.gz file1 -C /var/www/ but it creates the archive in the current ...
2
votes
1answer
1k views

linux tar listed-incremental untrustworthy

I'm looking for some way to troubleshoot incremental backups with tar on linux. I've got huge datasets (about 3TB) that need backing up to tape. For this I use the linux tar command and mt / mtx on ...
24
votes
5answers
63k views

How to extract specific file(s) from tar.gz

How can we extract specific files from a large tar.gz file? I found the process of extracting files from a tar in Untar only a certain number of files from a large tarball but, when i tried the ...
3
votes
0answers
42 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 ...
1
vote
2answers
41 views

Automatic backup and exclude of certain folders

I have created the follow bash script to be used in cron for automatically backing up certain folders while also excluding certain sub folders: folders_to_backup=( "/first/folder/to/backup/" "...
0
votes
1answer
41 views

How to Tar Much With Big .tar Parts on vfat? [duplicate]

I have now just one vfat USB stick in travelling but I still need to take backups. I get gzip: stdout: File too large because vfat's limiting files bigger than 4.3 Gb. My backup command sudo tar czf /...
3
votes
1answer
32 views

Can tar archive files in parallel?

I'm trying to move parts of a large directory (~40 GiB and ~8 million files) across multiple machines via Amazon S3, and due to needing to preserve symlinks I am tarring up the directory and then ...
1
vote
1answer
1k 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 ...
3
votes
3answers
124 views

Repacking a tar or tar.gz file into smaller tar/tar.gz files

I have a tar.gz file which contains a few million files in it. I want to divide the contents without decompressing it due to a cap on the number of files. Is there a way for me to divide a tar/tar.gz ...
0
votes
2answers
26 views

how to compress a folder without to leave the original folder and without to remove the original folder

under SQL directory we have only the tmp folder (tmp folder usage 59G) is it possible to compress the folder tmp without to leave the original tmp folder ? , so the compression will work on the ...
35
votes
9answers
81k views

tar --exclude doesn't exclude. Why?

I have this very simple line in a bash script which executes successfully (i.e. producing the _data.tar file), except that it doesn't exclude the sub-directories it is told exclude via the --exclude ...
1
vote
3answers
92 views

How to Distribute Computing of `tar czf` for Longer Time?

My systems go under heavy load when I run sudo tar czf /media/masi/ntfsDisc/backup_home.tar.gz $HOME/ Fans goes to max etc. I would like to find a better balance between computing and power ...
1
vote
1answer
37 views

How to load directory into filesystem cache?

I have a several GB directory that is rarely accessed, but when it is I'd like to be able to read the files in it quickly instead of having to wait. Since the files are rarely accessed they will not ...
-2
votes
3answers
31 views

Making tar file to un tar file

using Red Hat Enterprise Linux Server release 5.6 (Tikanga), when I fire tar command it's taking huge time to untar file. Below is the command which I have used: tar zcvf filename.tar filename ...
11
votes
4answers
7k views

creating archive using tar including all 'dotfiles' but excluding all subdirectories and /wo directory structure

I want to backup all the 'dotfiles' (f.e. .zshrc) under my home directory with tar, but excluding the directory structure and all subdirectories. I've tried it several times with different commands, ...
3
votes
2answers
211 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
0answers
34 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 ...
7
votes
2answers
7k views

Can I automate tar's multi-volume-feature?

Ok, so I've just had a read through this page after a way to improve my current backup solution on my Debian server. Tar seems to be offering a quite nice multi-volume feature, although when I try it ...
0
votes
1answer
19 views

Tar --exclude directory isn't being excluded

I need some help with my backup script. Looks like it's excluding all the directories I've specified except for one /var/backups which contains the tar file just created with the script. What am I ...
1
vote
1answer
56 views

Extract hard link files with tar

I am trying to get list of all files in tar folder show them all on a page with links to download files. On click on single files it will be downloaded. This all is working fine except the hard link ...
4
votes
2answers
74 views

Print archive file list instantly (without decompressing entire archive)

A problem with .tar.gz archives is that, when I try to just list an archive's content, the computer actually decompresses it, which would take a very long time if the file is large. Other file ...
3
votes
3answers
2k views

How to install BPG (Better Portable Graphics) on Linux Mint 17?

How do I install BPG (Better Portable Graphics) on Linux Mint 17? I downloaded the tar.gz file from Fabrice Bellard's website. The ReadMe file says, Edit the Makefile to change the compile ...
1
vote
1answer
50 views

tar specific files in several different subdirectories

I have the following folder structure A |-B | |-C | |-1.log | |-2.log |-10.log |-D |-E |-F |-php.log |-H |-php.log I want to collect all the log files and the php file present ...
2
votes
2answers
322 views

Tar a list of files which don't all exist

I'm running a command from a script like tar -c -f ar.tar a b c d where b, c, and d may not exist, and may be directories. The solutions that I've come up with are piping the output of ls -d to ...
1
vote
1answer
52 views

Restoring file system using tar causes login loop

Note: I am doing this to learn more about linux. I understand there are other tools that can be used with simple interfaces. Note: I am using Fedora 23. I have it installed physically on an SSD and ...
1
vote
5answers
68 views

tar without preserving user [duplicate]

I'd like to compress some files for http distribution, but found that .tar.gz keeps the user name and user ID and there doesn't seem to be any way to not do that? (There is a --numeric-owner option ...
1
vote
1answer
44 views

Compressing a folder but do not compress specific file types but include them in the gz file

I am using tar with pigz to compress a folder and save a backup. Size of this folder ~250 GB or more. This folder has variety of content including numerous text and log files, ISOs and zip files in ...
2
votes
0answers
30 views

Why does tar list multiple entries for some files? [duplicate]

In a folder with a single file (image.jpg) I run the following commands $ ls -a . .. image.jpg $ tar cf target.tar image.jpg Listing contents of the archive $ tar tvf target.tar -...
10
votes
4answers
14k views

Efficiently remove file(s) from large .tgz

Assume i have an gzip compressed tar-ball compressedArchive.tgz (+100 files, totaling +5gb). What would be the fastest way to remove all entries matching a given filename pattern for example prefix*....
1
vote
1answer
52 views

Extracting files to current directory

I want to find and tar/archive all my scripts ending .sh so I wrote something like that: touch ~/archive.tar; find ~ -type f -name '*.sh' -exec rvf ~/archive.tar {} \; The problem is that after I ...
2
votes
2answers
91 views

Using tar with find

Lets say we want to find a certain files , use tar on them and delete them. I tried using touch "mycompress.bz2.tar" find . \( -name "*.c" -o -name "*.sh*" \) -exec tar ujf "mycompress.bz2.tar" {} "+"...
3
votes
1answer
40 views

Can I somehow update compressed archives?

I'm trying to find all files with given extension but I'm getting this error: tar: Cannot update compressed archives Try 'tar --help' or 'tar --usage' for more information. tar: Cannot update ...
3
votes
4answers
101 views

'find -mtime -1 -print | xargs tar' archives all files from directory ignoring the -mtime -1 argument

I'm trying to create a backup script. I've managed to get this script working fine on a CentOS 6.7 machine and am now trying to get it working properly on Debian 7. I am running into a problem I can'...
2
votes
2answers
8k views

Create .tar.gz from a directory omitting some subdirectories and add only new or changed files

I need to create a script, maybe bash, maybe just a .sh that checks for files changes on a root directory and sub-directories of the root, and adds to a new file. The tar.gz file name should have the ...
3
votes
2answers
44 views

tar while avoiding compression of certain file types

I'm trying to create a very large backup of an entire hard disk, using tar. However, there are many files such as CR2 (Canon RAW 2), JPG and a few other files which are already compressed. I have ...
13
votes
3answers
29k views

Extract multiple .tar.gz files with a single tar call

I was wondering whether (and, of course, how) it’s possible to tell tar to extract multiple files in a single run. I’m an experienced Unix user for several years and of course I know that you can use ...
6
votes
3answers
477 views

A lot of “._” files inside a tar

I have a tar that was generated on a linux machine. I need to upload part of that tar to another linux machine. The full tar is huge and will take hours to upload. I am now on a Mac OSX machine and ...
4
votes
1answer
41 views

Tar directory into independent archive files no larger than a certain size

I have a directory containing many files. Together, these files take up several gigabytes of space. I'd like to compress this directory. But compressing the directory into a single file will make ...
1
vote
2answers
46 views

Correct syntax for including .* directories with tar

I'm trying to include files that match */*/.thisdirectory/* in a tar archive. What's the correct syntax? Apparently this is not: > find . . ./bar ./bar/.a ./bar/.a/baz ./foo ./foo/.a > tar --...
5
votes
2answers
70 views

Change user id and group id ownership of files within a tarball?

I have a tarball and the files it contains do not have the right user and group ownership. Files are owned jenkins:jenkins and I'd like them to be owned naftuli:othergroup. Is there a way for me to ...
14
votes
5answers
1k views

Compress a large number of large files fast

I have about 200 GB of log data generated daily, distributed among about 150 different log files. I have a script that moves the files to a temporary location and does a tar-bz2 on the temporary ...
1
vote
2answers
38 views

How to extract files to “/usr” directory without overriding other files?

I download swift installation package, and extract it into my home directory: # tar -C / -xvf swift-2.2.1-RELEASE-ubuntu14.04.tar.gz swift-2.2.1-RELEASE-ubuntu14.04/usr/ swift-2.2.1-RELEASE-...
0
votes
1answer
42 views

tar directories containing spaces [duplicate]

I want to archive my photos into tar archives. The directory containing photos has one dir per year and multiple dirs inside each year dir: Photos 2005 2006 Some dir with spaces ...
1
vote
1answer
44 views

unzip/untar files using Curl in ftp server

In the curl command we can delete,rename and move files from a FTP server using Curl like in the command below: curl -v -u username:pwd ftp://host/FileTodelete -Q "DELE FileTodelete" Can we untar ...