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

learn more… | top users | synonyms

0
votes
1answer
50 views

How to recover a .tar backup

I've a .tar backup, when I try to extract using below command. tar -xvf backup.tar Nothing is extracting and no errors or warning Seems like its corrupted. Is there any way to recover the .tar ...
0
votes
1answer
438 views

bash: /usr/bin/find: Argument list too long

I have too many files in a folder. I just want my inodes to be get free as soon as possible,So I have tried with find ./EcoBackup/* -name '*.*' > FilesBackupName.txt bash: /usr/bin/find: Argument ...
1
vote
2answers
50 views

Remove Specific File From Tar Archival Process After the Process Starts

When tar-ing up large directories (ie. a home folder for a backup/OS reinstall), it is often okay to exclude certain large files such as multi-GB videos. However, due to the all-encompassing nature of ...
4
votes
2answers
50 views

Tar is currently reading a 2GB file, and I deleted its only link. How do I stop it from running for an eternity?

Some more information: I was backing up a large directory with tar, only there were a couple of large files there that I didn't expect. This connection is over the network and very slow, so simply ...
0
votes
1answer
53 views

Tar archive list in a bash script

I have a function bound to an alias for easy listing of archives. function list-tar-archive { if [ "X$1" != 'X' ]; then out=tar -tf $1 | awk -F/ '{if (NF<3) print }' echo ${out} fi } ...
0
votes
1answer
108 views

change tape on the fly script

I have to write 17 Tb to tape: ssh some_host 'tar -cz /' | dd bs=20b of=/dev/tape of course 17 Tb doesn't fit to one tape so I need automatically change it when "no room" error occurs. I have ...
0
votes
0answers
21 views

Extract tar archive ignoring the Archive file name in single command [duplicate]

I would like to extract a tar file archive.tar.gz into a directory /Users/guest/data without the creation of the archive directory in the data directory tar -xvf archive.tar.gz -C /Users/guest/data ...
16
votes
4answers
2k views

tar and its key letters: is it a bug or feature?

I am wondering to ask the difference of these two commands (i.e. only the order of their options are different): tar -zxvf foo.tar.gz tar -zfxv foo.tar.gz The first one ran perfectly but the ...
0
votes
3answers
429 views

shell script to backup files in a specified directory

tar -czvf /var/local/mybackup.tar.gz -C /etc/alternatives/ I used the above mentioned code to create a backup file. But it is showing me this error. tar: Cowardly refusing to create an empty ...
4
votes
2answers
80 views

How to untar a file skipping the beginning of the directory structure?

I created tar archives with an absolute path to save the files. /home/mydir/dir1/dir2/dir3/file1.dat /home/mydir/dir1/dir2/dir3/file2.dat /home/mydir/dir1/dir2/dir3/file3.dat I would like to untar ...
-1
votes
2answers
509 views

take tar and copy to remote server and extract that tar

I want to take tar from a logged in shell and take that tar file to a remote host and then extract the tar file over there. I've got below command but the tar itself is not creating. time=`date` ...
5
votes
1answer
605 views

Untar filenames in a character encoding different from encoding used in the filesystem

I occasionally get tarballs where the filenames are encoded in ISO-8859-1 or some other pre-Unicode scheme. My system uses UTF-8, so when I untar these archives with the usual options (tar xvf foo....
1
vote
1answer
131 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 ...
0
votes
1answer
63 views

exclude files in tar.gz

I want to exclude two files from a tar file.. But it doesn't seem to work cd /var/www/public/api_test tar -zcvf api_v2.x.tar.gz api --exclude "./api/distributor_test.php" --exclude "./api/library/...
0
votes
1answer
74 views

How to ignore adding modified time to archive file while compress using tar

Can we instruct tar to do not keep modified time of the files in archive file while compress. What I want is, the extracted directories/files should get time from machine where it's extracting, not ...
0
votes
1answer
87 views

How to exclude directories from tar in this script?

Answering my own question yesterday, I wrote a bash script which archives all directories within a defined directory into their own separate archive files. I have also defined a variable for a file ...
-2
votes
2answers
193 views

What is the default path of newly created tar archive?

I created tar archive using following command: tar -zcvf archive-name.tar.gz directory-name After this operation, where that tar.gz is located?
0
votes
2answers
338 views

How do I archive a folder keeping owners and permissions intact?

Is there any way to archive a folder and keep the owners and permissions intact? I'm doing a backup of some files, which I want to move using a usb-stick, which has a FAT filesystem. So the idea was ...
3
votes
2answers
3k views

tar command - skip symlinks

I use the tar command as, tar -cvf protTests.tar protTests/* to tar all files inside the folder, protTests. But this is including the symbolic links inside the folder, which is not a desired one. ...
6
votes
2answers
491 views

How to use tar to compress a group of files in a .txt file?

I have a lot of filenames that listed in a .txt file called to_be_archived_files.txt, and its content is as: ~/Documents/dir1/a.html ~/Documents/dir1/b.html ~/Documents/dir1/c/1.html How do I add ...
3
votes
2answers
186 views

Archiving to remote-machine with tar/cpio and ssh?

I'm renting a couple of VPS with Ubuntu, and I've managed to fill-up one of them. Here I've got several directories with lots of files I'd like to put into an archive. Unfortunately, I don't have ...
1
vote
1answer
253 views

How to create a tar of a chroot?

I want to capture everything in a chroot but am unsure whether I need to first chroot into it to see the full filesystem/preserver permissions etc. From outside the chroot, it seems like I would miss ...
3
votes
1answer
107 views

Where the term “tarball” comes from?

I use unix distros every day and I started using them a long time ago but I never thought about the provenience of the word "tarball". I tried to search it on the dictionary but I didn't find anything....
2
votes
1answer
71 views

creating a xar archive using the tar utility in FreeBSD

I am trying to create a xar archive using the tar utility in FreeBSD tar -c -f test --format xar index.html I get the following error Can't use format xar: Xar not supported on this platform How ...
8
votes
4answers
403 views

How can I filter the contents of a tar file, producing another tar file in the pipe?

Consider a single tar file from an external system which contains some directories with various attributes which I want to retain such as permissions, mtimes, etc. How can I easily take a subset of ...
4
votes
1answer
285 views

Install powernap on debian?

I just read about powernap here but don't know how to install it.. Download and untar was simple: axel https://launchpad.net/powernap/trunk/2.20/+download/powernap_2.20.orig.tar.gz && tar -...
6
votes
7answers
474 views

Unix : how to tar only N first files of each folder?

I have a folder containing 2Gb of images, with sub-folders several levels deep. I'd like to archive only N files of each (sub) folder in a tar file. I tried to use find then tail then tar but couldn'...
1
vote
0answers
183 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 ...
-1
votes
1answer
88 views

how to untar a file in Ubuntu? [closed]

Whenever I am writing this: tar - xvf grads-2.0.2.oga.2-bundle.tar.gz I am getting this: You must specify one of the '-Acdtrux', '--delete' or '--test-label' options How to use this?
1
vote
1answer
874 views

XZ - Cannot allocate memory

If i run this command: XZ_OPT=-9 tar --xz -cvf files/compressed/xz/archive.tar.xz -C files/original/ . Get this message: xz: (stdin): Cannot allocate memory tar: files/compressed/lzma//archive....
1
vote
1answer
117 views

Set LZMA compression level via tar [duplicate]

How can I set the compression level for this command? tar --lzma -cf files/compressed/lzma/archive.lzma -C files/original/ . With --bzip I just use: BZIP2=-9 tar --bzip2 -cf files/compressed/bzip2/...
2
votes
1answer
87 views

Output file generated by tar

tar can be used to gather a whole directory into a single file. I tried with the sample directory sampledir containing just some text files, with no subdirectories. Originally the directory occupies ...
2
votes
1answer
1k views

Why I can't unpack .tar.bz2 or .tar.xz files?

I'm having a problem unpacking files when I try to build from source on my OpenBSD First I thought it was just corrupted files but after it happened to many different programs and from different ...
0
votes
2answers
73 views

How to determine where a tarball expanded

I ran the following on Redhat linux: tar zxvf jdk-7u79-linux-x64.tar.gz resulting in: jdk1.7.0_79/ jdk1.7.0_79/LICENSE jdk1.7.0_79/release jdk1.7.0_79/jre/ jdk1.7.0_79/jre/LICENSE jdk1.7.0_79/jre/...
0
votes
4answers
343 views

How to delete files from a directory based on the contents of a gzipped tar file?

Given that I: have a directory that contains over 1000 files have a gzip'ed tar file that contains a subset of those files (x.tgz) What is the single command line (if it is possible) that will ...
4
votes
2answers
60 views

Can I store and work with a directory in compressed form?

I have to work with many large sized directories which are shipped around in the form of tarballs. However, in order to really do any operations these tarballs have to be untarred into directories and ...
1
vote
1answer
122 views

tar in parallel [duplicate]

I have a directory with several hundred sub-directories. I want to tar and compress each sub-directory and name the resulting file <currentDirName>.tar.bz2. I have done: find ./dir -type f -...
1
vote
1answer
68 views

tar ignoring “newer” option

How do I get tar to only include files newer than a certain date? I have tried the following, both of which include older and newer files (today is 2015-07-20): tar -cj -N 2015-07-07 directory | tar ...
8
votes
3answers
3k views

Pack file with tar.gz from root directory

I try to pack a .csv file with tar.gz, while being in the root directory. The file myfile.csv is located at /mnt/sdb1/ So the full filename is /mnt/sdb1/myfile.csv I try to save the tar.gz under /...
3
votes
2answers
128 views

create flat tar archive: ignoring all parents when adding folders

I want to add a few folders (recursively) to a new tar archive. All of the folders should be at the root level of the resulting archive. Is there any way to add all folders without their parents, and ...
2
votes
1answer
64 views

How to tar-bzip old files in yearly groups

I wish to know a command I can use to grab and archive all files for a year at a time. I am working on a directory that has 72000 files, with files dated from 2007 to current. And I wish to make that ...
2
votes
2answers
177 views

tar extract hangs on non-existent file

I tried to extract a valid tar gzip file, P.tgz. It hangs infinitely. tar -x P.tgz This archive is of very small size. But it never gets completed. I tried with a non-existent tar archive, ...
3
votes
4answers
2k views

Is it possible to make a .tar.gz file directly from stdin? Or, I need to tar together already gzipped files

I'm going to tell you exactly what I need in order to clarify the cryptic question in the title. I'm currently making scheduled MySQL backups of all my databases with something like: mysqldump ... | ...
0
votes
1answer
112 views

Can I use lzma compression, without using “tar”, on OSX 10.10.3?

I kind of think of OSX as Unix by another name. But, if I need to move this to the Apple forum, please tell me! I can create tar files compressed using lzma as such: $ ls ./DbDumps alpha.dmp ...
1
vote
3answers
92 views

Include subdirectory from excluded directory in a tar archive

I have the root folder USA and sub-folders California and Texas. Texas is an excluded sub-folder but it has a specific file in it that I'd like to include in the tar backup. Let's call this file ...
4
votes
1answer
88 views

How can I repair a tar file where stderr got mixed with stdout?

I have a tar file that I'm trying to repair. The problem is that tar's stderr got mixed in with its stdout, so the file looks like this: % head android-1435613730.tar tar: removing leading '/' from ...
2
votes
1answer
353 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
196 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 ...
8
votes
3answers
559 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
2answers
302 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 ...