tar

Ant: Create tar without path information?

Update: I am using Ant 1.8.1 on Windows XP. I am trying to write an Ant master build file for multiple projects. I can successfully create a jar for each project, and I want to package all of these jars into a single tar.gz file. Each jar file is located within the bin subdirectory of its respective project, but this path could be ch...

Creating the same .tgz file on different machines

I'm using giternal, which compresses the .git directory of the external references into a .tgz file. Unfortunately, every time I "freeze" the external, a new .tgz file is created for the repo. Even though the contents of the .git directory are the same, a new .tgz file, with diffs, is created. This leads to repo bloat. Is there a way t...

Autotools - tar This does not look like a tar archive

After running make distcheck I get the message that I have successfully built the package and is ready for distribution. If I untar the tar.gz with tar -zxvf hello-0.2.tar.gz it successfully extracts all of its contents. However, when I try to extract them in different machines I get: tar: This does not look like a tar archive tar: Skip...

Extract a tar.xz in C/C++

I am writing a program that downloads tar.xz files from a server and extracts them in a certain place. I am struggling to find a away of extracting the tar.xz file in the certain place. I am using Qt so a more Qt-way of doing it would be useful, but I don't really mind. ...

tar --files-from complains "Cannot stat: No such file or directory"

When I type " tar -cvf ~/changeset.tar --files-from ~/changeset.txt", It responds with this output: http://pastie.org/1071080. Here is the contents of ~/changeset.txt: http://pastie.org/1071084 . In other words, a bunch of relative paths. As a sanity check, $ ls admin/memberinformation.php admin/memberinformation.php Why can't tar find...

headers to force the download of a tar archive

Hi, i have a tar archive on the server that must be downloadable through php. This is the code that i've used: $content=file_get_contents($tar); header("Content-Type: application/force-download"); header("Content-Disposition: attachment; filename=$tar"); header("Content-Length: ".strlen($content)); unlink($name); die($content); Th...

Get big TAR(gz)-file contents by dir levels

I use python tarfile module. I have a system backup in tar.gz file. I need to get first level dirs and files list without getting ALL the list of files in the archive because it's TOO LONG. For example: I need to get ['bin/', 'etc/', ... 'var/'] and that's all. How can I do it? May be not even with a tar-file? Then how? ...

How to perform incremental tar backup of FAT filesystem

I use tar --listed-incremental=... to perform incremental backups on my computer, and for the most part it works like a charm. However, it doesn't seem to play well with my old FAT partition. It thinks that all the files have changed and backs up everything. I read somewhere that tar incremental backups rely on inodes, and that's why ...

Untar contents to same directory

I have this scenario in UNIX: I am tar'ing files of a directory like this: tar cvf test.tar /dir1/dir2/file1.xml /dir1/dir2/file2.xml When I copy this tar file to a different directory and Untar it, I want the two files(and all the other files) to be untared in the curent directory only. How can I do this? Btw, I must be using the ab...

Extract 1 file from tar.gz with bash

Is it possible to programmatically pull a single file from a decently sized .tar.gz without extracting the entire tarball to disk? Essentially I need to get inside large tar.gz files over the network and extract 1 small text file. It seems somewhat over-the-top to pull and extract the tarball to disk, then pull the file out, then delete...

Organizing files in tar bz2 file with python

I have about 200,000 text files that are placed in a bz2 file. The issue I have is that when I scan the bz2 file to extract the data I need, it goes extremely slow. It has to look through the entire bz2 file to fine the single file I am looking for. Is there anyway to speed this up? Also, I thought about possibly organizing the files in...

Simple tar implementation?

Hallo, I'm looking for a really simple and easily hackable tar library for C or C++. Ideally it should have a permissive license (BSD/LGPL) and not have a ton of Unix/Windows OS dependencies, as I plan to use it from an embedded RTOS... Any ideas? ...

UNIX untar content into multiple folders

I have a tar.gz file about 13GB in size. It contains about 1.2 million documents. When I untar this all these files sit in one single directory & any reads from this directory takes ages. Is there any way I can split the files from the tar into multiple new folders? e.g.: I would like to create new folders named [1,2,...] each having 10...

create a tar file in a string using python

I need to generate a tar file but as a string in memory rather than as an actual file. What I have as input is a single filename and a string containing the assosiated contents. I'm looking for a python lib I can use and avoid having to role my own. A little more work found these functions but using a memory steam object seems a littl...

Passing a filename via a variable to tar from within PHP?

I am trying to ultimately extract some files from a tar archive within PHP, however my simple test script is failing at the first part, which was to simply list the files in the archive. Is there any reason why this test script fails? What I see output is: > -sh-3.2$ php showfile.php /var/www/vhosts/smartphonesoft.com/httpdocs/fred/ep...

How can I tarball the proc file system?

I would like to take a snapshot of my entire proc file system, and save it in a tarball (or in the worst case concatenate all of the text files together into a single text file). But when I run: tar -c /proc I get a segfault. What's the best way to do this? Should I set up some kind of recursive walk through each file? I only have...

uncompressing a large number of files on the fly

i have a script that i need to run on a large number of files with the extension *.tar.gz. what i want to do is instead of uncompressing them and then running the script, i want to be able to uncompress them as i run the command and then work on the uncompressed folder, all with a single command. i think a pipe is a good solution for t...

tar: add all files and directories in current directory INCLUDING .svn and so on

Hi all, I try to tar.gz a directory and use tar -czf workspace.tar.gz * The resulting tar includes .svn directories in subdirs but NOT in the current directory (as * gets expanded to only 'visible' files before it is passed to tar I tried to tar -czf workspace.tar.gz . instead but then I am getting an error because '.' has changed...

php exec tar call fails when run via cron, works via shell

Can anyone explain why this line works when called from shell, but fails when called via crontab? passthru("tar xvf $file $tarfile/application $tarfile/application_detail $tarfile/application_device_type $tarfile/genre_application"); } The error I got emailed after cron was tar: itunes20100907/application: Cannot open: No such f...

-C option is ignored when calling tar via PHP

If I run my PHP file from the shell, then the tar command extracts to the directory I am in, rather than the one I specified using -C My command is passthru("tar xvf $file $tarfile/application $tarfile/application_detail $tarfile/application_device_type $tarfile/genre_application -C /var/www/vhosts/httpdocs/fred"); How can I have it...