Hot answers tagged

5

Because of the nature of a tar archive which sequentially stores the files in the output, there is no way to parallelize the process unless you make more than one archive. Note that the bottleneck of the operation would likely be the hard drive. For that reason, even if you did split the task in two or more processes, it would not go faster unless they ...


4

In a word, "no" :-) Linux tar will not stop any other process from reading the files while it is running. If you are concerned about writing the tar doesn't block that either, but if a file changes while tar is reading it then you'll get a warning message; if the directory structure changes while tar is in the middle of it then you might see some oddities ...


4

tar will unpack its archive in the order that it was created. ( echo foo; echo foo/a; echo b; echo foo/c ) | tar --no-recursion --files-from=- -cvf /tmp/tar.tar and tar tvf /tmp/tar.tar drwxr-xr-x roaima/roaima 0 2016-06-27 20:20 foo/ -rw-r--r-- roaima/roaima 0 2016-06-27 20:20 foo/a -rw-r--r-- roaima/roaima 0 2016-06-27 20:13 b -rw-r--r-- roaima/roaima ...


2

If I'm understanding what you want correctly, you can simply pass directory/files names to tar. tar -cvf tarfile.tar SomeDir/ OtherDir/theFile.f Upon extracting: [user]$: ls OtherDir SomeDir tarfile.tar [user]$: tar -xf tarfile.tar [user]$: ls SomeDir/ someFile1.a someFile2.b someFile3.c someFileN.xyz [user]$: ls OtherDir/ theFile.f


2

You can split it with split, but the individual pieces won't make any sense until put back together. If you want to split it into self-contained archives, you will need to decompress it.


1

If you have an USB stick bigger than 4 GB and you want to put big files on it, try NTFS. (You could also use Ext[234], but you wouldn't be able to read it on Windows, while NTFS naturally works on Windows). No more worrying if your file is bigger or smaller than than 4GB. Some graphical formatting programs will suggest NTFS as an option, otherwise man mkfs....


1

It is not possible to split the compressed tar archive into pieces without decompression: the compression is applied on top of the 'tar stream' and this stream is treated by a compressor as an opaque binary stream. Thus, any tool that could produce a set of tar files from your original compressed tar archive will actually decompress it. The tar itself ...


1

split is the right tool for it. To split a file in 10MB chunks split -b10m /path/to/file parts To put it together cat parts* > file


1

There are two problems to solve: how to remove the files without interfering with your output, and where to put the output while it is being created. If you happen to not have any dot-files in /var/backup/SQL, it is simple: just create your output named with a leading ".", add to the tar-file using the --remove-files option, and rename the output to ...


1

The command tar czf /media/masi/ntfsDisc/backup_home.tar.gz $HOME/ is the same as this: tar cf - $HOME/ | gzip > /media/masi/ntfsDisc/backup_home.tar.gz When you ran top, it showed the gzip was using up around 100% of one cpu thread. The NTFS FUSE software is using up a nonzero amount of CPU, too, but essentially you're CPU-bound because of that ...


1

i was trying to extract a couple of hundred files from tarball with thousands of files the other day. the files i need can not be referenced by a single wildcard. so i googled and found this page. however, none of tricks above seem good for my task. i ended up reading the man, and found this option "--files-from", so my final solution is gunzip < ...



Only top voted, non community-wiki answers of a minimum length are eligible