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

learn more… | top users | synonyms

-1
votes
2answers
79 views

What's wrong with this tar command? [closed]

find /informatica/dev/SrcFiles* -mtime +7 -and -size +1M -exec tar -rvf files.8.2.2013.tar {} \; This command is running/working correctly and I'm not sure whats wrong. I want to find the files that ...
0
votes
2answers
101 views

find command and tar

find /informatica/dev/SrcFiles* -mtime +7 -and -size +1M -exec tar -cvjf> So I ran this command and I can't find the file after it was done running (probably because I never named it?). The ...
4
votes
2answers
657 views

How to download an archive and extract it without saving the archive to disk?

I'd like to download, and extract an archive under a given directory. Here is how I've been doing it so far: wget http://downloads.mysql.com/source/dbt2-0.37.50.3.tar.gz tar zxf dbt2-0.37.50.3.tar.gz ...
1
vote
0answers
117 views

Disk partition emptied during tar backup

This morning I was doing a routine backup of my development drive, one of 4 primary partitions on my hard-drive. The script I ran was: filename="/home/Backups/Devi_"`eval date +%Y%m%d`".tgz" touch ...
7
votes
3answers
2k 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, ...
4
votes
1answer
183 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 ...
2
votes
2answers
755 views

Verifying a .tar.gz backup

Edit 3: For people who will read this question: --verify mysteriously fails with "Warning: Cannot seek: Illegal seek", hence I recommend you look for alternative ways to verify your archives. My ...
3
votes
4answers
704 views

Why is my tar file bigger than the directory backed up

This question did not help me (despite having the same title). So I post this even though this is a duplicate question. As far as I can tell, the total in du -k includes all the subdirectories and ...
6
votes
3answers
2k 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 ...
1
vote
2answers
1k 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 ...
1
vote
0answers
181 views

How to do incremental backup of .img files containing windows partition?

On an OVS I have a few windows machines. I want to create a full backup their .img disk files, thats done, .img.gz. Than I want to incrementally backup their C:/ partition, but thats not working. ...
4
votes
2answers
106 views

Where can I find updated TAR.rpm for Oracle VM Server?

I'm using tar for my incremental backup script on Oracle VM Server 3.2.2 and it comes with tar 1.15.1 I need this command: tar -cf drive-C.full.tar --no-check-device \ ...
1
vote
6answers
657 views

How to avoid overwriting existing files while using tar command?

The tar command just overwrote my file an hour ago while I was trying to make a tar to backup it. I ran tar zcvf foo.tex foo.bib and after that my tex source file lost. What's worse, this is the ...
1
vote
2answers
235 views

Why is my tar file bigger than its contents?

I have a tar file that I have recreated from two files - xaa, xab (the results of using the split command). The tar file is the size I expect it to be but when I extract it the folder I get is a ...
1
vote
1answer
806 views

Ignore Symlinks when Extracting Tarball

I have a relatively simple question that I cannot seem to find the answer for. I am attempting to extract a tarball (*.tgz, to be exact) and receiving terminal errors on extracted symlinks. ...
-1
votes
1answer
49 views

What are the relative merits of the various standard Unix archival utilities? [closed]

There are many archival tools for Unix, with varying degrees of availability. To make matters more confusing, many of them can write each other's formats. I am seeking more information on their ...
3
votes
1answer
188 views

How can I copy a file between server using bsdtar?

I'm looking for the fastest way of copying a file between 2 linux servers using bsdtar. With normal tar, I would do something like: ssh root@remote 'tar -cz -C /my/path/ big_file.txt' | tar -zxv ...
2
votes
2answers
3k views

How to install tar file (jhead) on Mac or Linux machine

I'm new to Linux and tar balls and was wondering how to properly install them on a Mac or Linux machine. I would prefer to know how to install on a mac but I just need some help understanding them. I ...
9
votes
3answers
850 views

Universal extractors

With an increasing number of archive/compression file formats, is there a single free/open-source command line tool to rule them all? Perhaps something with a consistent / unified set of flags? (note ...
7
votes
1answer
842 views

Under what circumstances does gunzip & tar xf work but tar xzf fail?

To illustrate the point: I have downloaded the LEDA library from the company's website. Using tar -xzf on it fails: $ tar -xzf LEDA-6.3-free-fedora-core-8-64-g++-4.1.2-mt.tar.gz tar: This does not ...
2
votes
2answers
3k views

How to scp/tar files that are in between specific days?

I need to copy db log files between two suse servers where I am interested in files ONLY in between 10.3.2013 - 13.3.2013 It is desired to compress the files before copying so I tar them and scp. ...
1
vote
1answer
655 views

Difference between --xz and --lzma in GNU tar?

As far as I can tell, XZ is a container that uses the LZMA2 algorithm (i.e. extended LZMA); but e.g. $ xz foo/ complains about foo/ being a directory. So presumably the correct way to preserve ...
3
votes
8answers
2k views

Triple compression and I only save 1% in space?

I've been trying to save space on my linux server, and I had a folder containting, in subfolders, 22GB of images. So I decided to compress them. First I used tar: tar -zcf folder.tar folder Then ...
2
votes
1answer
80 views

Do tar archives include user/group name by default?

In tar's man page I stumbled upon two options: --numeric-owner: always use numbers for user/group names --owner=NAME: force NAME as owner for added files This made me wonder: When I tar ...
2
votes
6answers
1k views

How to make tar globbing work with the 'change directory' option

I have the followin directory structure: base/ files/ archives/ scripts/ I want a script to run from scripts/, compress files that match results.*.log in files/ into a gzipped tar archive ...
8
votes
1answer
6k views

scp and compress at the same time, no intermediate save

What is the canonical way to: scp a file to a remote location compress the file in transit (tar or not, single file or whole folder, 7za or something else even more efficient) do the above without ...
3
votes
2answers
2k views

Remove files from tar archive

I have a large file foo.tar.xz that contains a lot (say 200000) of files. I figured out that this archive contains some (around 5000) files I don't want. I don't have sufficient disk space to ...
2
votes
4answers
83 views

What year did the Unix “tar” program get released?

Here's an simple question: what year did the Unix "tar" (TApe ARchive) come out? I wasn't able to find the answer with Internet searches.
0
votes
2answers
128 views

Can tar archiver zerofill a file?

I have received a tar archive from a co-worker and after decompresing I found that some text files are corrupted. More precisely they are filled with zeros. They have correct size but all bytes are ...
5
votes
1answer
7k 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
634 views

Untar Without Top-Level Directory

I have a tar (websites.tgz) that contain a bunch of Drupal websites that are tarred up starting with 'htdocs' I need to untar them into /local/htdocs/web1 /local/htdocs/web2 and so on. But I ...
5
votes
3answers
516 views

Tar piped to split piped to scp

So I'm trying to transfer a bunch of files via SCP. Some of these are too large to be stored on the recipient (Android phone, 4GB file size limit). The sender is almost out of space, so I can't ...
3
votes
2answers
6k views

Create a tar archive split into blocks of a maximum size

I need to backup a fairly large directory, but I am limited by the size of individual files. I'd like to essentially create a tar.(gz|bz2) archive which is split into 200MB maximum archives. ...
5
votes
2answers
6k 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 ...
2
votes
0answers
300 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 ...
6
votes
1answer
2k views

Force the owner and group for the contents of a tar file?

I would like to create a tar file with contents belonging to an owner:group pair who do not exist on the system from which the file is being made. Here's the direction I've tried: tar ca ...
12
votes
5answers
14k views

tar: Removing leading `/' from member names

root@server # tar fcz bkup.tar.gz /home/foo/ tar: Removing leading `/' from member names How can I solve this problem and keep the / on file names ?
5
votes
2answers
3k views

tar files from another directory without copying them

This should be very simple for experts in here. I have a Linux account with user disk quota of only 6GB. There is some data-folder in /opt with about 3GB of data with when compressed comes up 1GB. ...
6
votes
1answer
467 views

tar: how can I exclude intermediate directories but include leaf directories?

I want to create a tar file suitable for extracting into /. I've created a work directory that represents the root of the file system, and it has all the stuff I want included in the tar underneath, ...
6
votes
1answer
1k views

On the Fly Compression for a Directory

I have a directory that is always going to be storing text files that are rarely (think weekly) used. Naturally this is a great place to use compression. However, rather than having to use tar ever ...
2
votes
2answers
6k views

Compress old log file into single zip-linux

I have a folder /home/testuser/log which contain log files of one day old *.log. I wish to compress all the log files older than one day to a single zip(gzip or tar.gz) and delete the older files. I ...
3
votes
3answers
419 views

Different count for compressed file listing vs directory listing

I was taking a backup of a folder, where I used the following command : sudo tar -zcvf www.tar.gz /var/www/ It successfully compressed, just for verifying the number of files in the compressed ...
5
votes
3answers
1k views

How do I resume a tar command which was killed

I was doing a : tar -cvf and I had to killed it with ctrl-C. I know I should have done a Ctrl-Z and then bring back the task to foreground... but it's not the story. Can I resume from the point I ...
1
vote
1answer
226 views

tar -c Error Messages and Source Files?

During a tar archiving operation with tar -cvf archive.tar source does the resulting tar archive that reports a file changed as we read it error still contain "some version" of the source file that it ...
4
votes
1answer
713 views

Does tar -x Extract to Current Directory or Does it Extract to the Source of the Archive?

Does tar -x by default just extract to the current directory or does it try to reproduce the original directory structure including overwriting the original source? I know I can specify a folder to ...
3
votes
1answer
2k views

Extrat tar “Cannot open: File name too long”

I made a tar with a directory on a remote machine with: tar -czvf I scp it to my local machine, where I wanted to untar it: tar -xzvf But I get : Cannot open: File name too long On my local ...
3
votes
3answers
454 views

Tar a file with a different name

To make my environment deployable, I occasionally tar up some handy files and scripts: tar -czvf env.tgz .vimrc .vim/ bin/lsl bin/s I would like to add .bashrc to the mix, but I have some sensitive ...
1
vote
2answers
4k views

tar: Unexpected EOF in archive

I am trying extract .tar.gz file it but with no luck gzip: stdin: unexpected end of file tar: Unexpected EOF in archive tar: Unexpected EOF in archive tar: Error is not recoverable: exiting now the ...
3
votes
1answer
168 views

How to create a folder which will change its contents’ ownership to what the folder has?

In a GNU/Linux OS there is no way to change ownership of a file until you are root. But what if I want to hide my system’s username e.g. before sending a file to someone, because some things like tar ...
2
votes
1answer
258 views

Issues while untaring tarball with acl

I am getting an error “Unknown file type 'A', extracted as normal file” while un-taring a set of files which has acl permissions set. I had created the tar file in Solaris with tar -cpfv ...