Tag Info

Hot answers tagged

8

No, you cannot append to a compressed tar file without uncompressing it first. However, tar can accept its list of files to process from a file, so you can just do: ls *.csv > temp.txt tar -zcf ball.tgz -T temp.txt @slhck points out that the above solution will not work if there are spaces (and probably other annoying characters) in your filenames. ...


7

Given your details, I assume that you have verified that your files really have 99% of data in common, with a contiguous (or almost contiguous) 1% of difference in them. First, you should use tar to make one archive with your files inside it. For tests, I would create a .tar with 10 files, so having a 300MB size. Then, using xz, you have to set it so that ...


7

You can use tar to achieve this : tar -cjf sample.tar.bz2 sample.txt tar is a program used to manage archives, the options here are -c to create an archive (it would be -xto extract one), -j to use .tar.bz2 format, and -f to specify output archive name. For more info : man tar.


6

I prefer oneliners like this: tar cf - /folder-with-big-files -P | pv -s $(du -sb /folder-with-big-files | awk '{print $1}') | gzip > big-files.tar.gz It will have output like this: 4.69GB 0:04:50 [16.3MB/s] [==========================> ] 78% ETA 0:01:21 For OSX (from Kenji's answer) tar cf - /folder-with-big-files -P | pv -s $((du -sk ...


6

If they are truly 99% similar as you say, you should be able to use bsdiff or a similar algorithm to calculate differences between the files. Is the difference cumulative (i.e., each file differs a little more from the first), or is the difference between any two files pretty much the same? If it's not cumulative, you should be able to: Take any arbitrary ...


6

You can combine the two commands as following: gunzip < file.gz | bzip2 > file.bz2 This will start two processes in parallel, gunzip reading the file.gz file and outputting the non-compressed stream to bizp2 to re-compress it into file.bz2. This process does not create intermediate files, you'll need to remove the file.gz afterwards (rm file.gz).


5

This is not the answer you want to hear, but this is not supported by GNU tar according to its manual: The only case when you have to specify a decompression option while reading the archive is when reading from a pipe or from a tape drive that does not support random access. However, in this case GNU tar will indicate which option you should use. ...


5

If you are using maveriks, then gnutar is no longer available. The work around if you use homebrew is to execute the following brew install gnu-tar ln -s /usr/local/bin/gtar /usr/local/bin/gnutar Source: https://github.com/jordansissel/fpm/issues/576


5

I would recommend using rsync; in case your connection gets interrupted rsync can pick up where it left (with a little overhead). rsync can working over ssh directly so it will still be secure. rsync -av -e ssh /path/to/send rsync://user@ubuntu.box/path/to/receive


5

The GNU version of tar supports the --transform option (and its alias --xform), you could use it like this tar --transform "s/^$MYPATH/$VERSION/" -cf archive.tar.bz2 "$MYPATH" For example, given this directory tree foo └── foo.txt the command tar --transform "s/^foo/bar/" -cf foo.tar.bz2 foo will produce an archive like $ tar -tf foo.tar.bz2 bar/ ...


4

It is not possible, because the files are first archived (tar) then the result is compressed as a whole (bz2 or gz). This is (edit: one of) the reasons why tar.bz2 or tar.gz are usually smaller than zip, specially when they contain a lot of small and similar files.


4

You can use the rsync command line tool to do a one-way synchronization of your files. The way rsync works makes it easy to interrupt the process if you don't have the patience for it—you can easily resume it later on. Only the files that are still to be transferred will be copied. You need to open Terminal.app, and then call rsync like so: rsync -avh ...


4

The only option --restrict currently disable is the ability to spawn a subshell with the ! command when you are prompted to replace a tape in a multi-volume archive. 2005/12/06 New function. Disable '!' command if given --restrict option. Reference: http://git.savannah.gnu.org/gitweb/?p=tar.git;a=commit;h=ffc4fb7bdd03d095c46233770eb1a40fcaa3999c


4

Here is another solution. It won't let you extract individual files from an archive and reduce its size, but it does let you extract all files reducing the size of the archive as you go: #!/bin/sh # $1, the first paramter, is the .tar.gz file to unarchive ( size=$(wc -c $1) offset=0 bs=4096 while [[ $size > $offset ]]; do dd ...


4

You just need some quotes to prevent the shell from misinterpreting the semicolons... [mpenning@tsunami ~]$ wget "http://git.cross-lfs.org/?p=bootscripts-embedded.git;a=snapshot;h=HEAD;sf=tgz" Resolving git.cross-lfs.org... 208.97.140.69 Connecting to git.cross-lfs.org|208.97.140.69|:80... connected. HTTP request sent, awaiting response... 200 OK Length: ...


3

next time when you reply to someone who commented on your question, use @, to reply to me @Fischer so i can be notified that you replied to me, otherwise I may never reply to you. I'll link to some tutorials. To create a tarball you go to the file location using cd, then you do tar -cvf example.tar /example Then to use rsync on a RedHat-based ...


3

You are asking about scp but the problem of writing to a full device appeared with tar. I understand the question that you want to copy the file(s) to the filesystem on the dev/mapper/vg_01-lv_u01 volume. For this you must use the mount point /u01 as the destination. scp scp dump.tar.gz user@machine:/u01/any/existing/path This way you specify the ...


3

tar can't do that, but you can achieve what you want with: find dir1 -depth -print0 | xargs -0 tar --create --no-recursion --remove-file --file - | bzip2 > dir1.tar.bz2 where: find dir1 -depth -print0 lists all files and directories in dir1, listing the directory contents before the directory itself (-depth). The use of -print0 (and -0 in xargs ...


3

Solution To install VLC on CentOS 6.4 Open the terminal and follow few steps cd /etc/yum.repos.d/ wget http://pkgrepo.linuxtech.net/el6/release/linuxtech.repo yum install vlc Enjoy open source environment.


3

I think you need tar's -J option in your pipe. e.g. | tar -xJf - The -J option tells tar to use xz compression. I think that the reason why tar xf transmission-2.80.tar.xz works without -J is that the option is inferred by tar based on the file extension.


3

Typically, really important VM's should be moved off the workstation and to a dedicated server. On My Mac, I turn on the auto snapshot feature inside fusion, and then let crashplan backup to my NAS. I can get away with this because I don't make a lot of changes to my VM's. You could try a multithreaded compression program such as pigz.


3

You could use rsync to create a backup copy of your $MINECRAFT_PATH. This will only copy those parts of the files that have been changed since the last run, so it should be relatively fast. (except for the first run ever, because then it has to copy everything) Once the rsync is done, you can restart the server. Then you use tar to make a tarball of the ...


3

tar is able to append to already existing archives, so you could do: touch tarfile.tar command_that_produces_file_list | xargs tar rf tarfile.tar Unfortunately, this doesn't work with on the fly compression. Luckily, the tar format is simple enough we can do some hacking: command_that_produces_file_list | { xargs -i sh -c 'tar c {} | head -c $(( (`stat ...


2

Good news. I get answer for my bug report to bug-tar@gnu.org , cite: From: Sergey Poznyakoff date: Thu, 05 Sep 2013 08:40:40 +0300 subject: Re: [Bug-tar] gnu tar, option -T from stdin or named pipe is not interactive Hi Grzegorz, This has been fixed in the git HEAD (starting from commit 1fe0c83d). Regards, Sergey ...


2

You could generate the listing of files relative to the $rootfs path and then use -C $rootfs -T <file-of-filenames> to create the archive. You cannot use a wildcard to generate the list of files on the tar command line as that will not complete correctly. You could use something like find or ls to do it though.


2

You don't need to install the windows version of tar and gzip, you just need to download 3 zip files, one which contains binaries for tar, one with the binaries for gzip and lastly the other contains the dependancies. Unpack the files, and follow the manual installation instructions, which tells you which files to copy from the dependency directory to the ...


2

You can use a single pipe, and keep a writer open on it so it doesn't close until you are done. terminal 1: mkfifo temppipe tar xvfj temppipe terminal 2: cat > temppipe We won't have cat write anything to the pipe, but it's presence will keep the pipe open while we run the dd commands. terminal 3: dd if=archive.tar.bz_part1 of=temppipe # and so ...


2

You need to open the file using something that reads and processes it as a stream, rather than trying to read the whole file into memory. Try installing Cygwin and managing the file using its command-line tools; for example $ tar zxf my-big-file.tar.gz something/I/want.doc will extract one file from your archive. As a Unix guy, naturally I offer a ...


2

Most people don't back up their workstation-hosted virtual machines. The options for this are limited and the use cases are narrow. Time Machine and rsync-style backups won't be helpful from an incremental perspective. Unfortunately, you haven't given any information about the operating systems running as guests on your Macintosh desktop/laptop. Your best ...


2

I had problems with unpacking tar and zip files I receive from Windows users. While I do not answer the question "how to create the archive which will work", the scripts below help to unpack tar and zip files correctly regardless the original OS. WARNING: one has to tune the source encoding manually (cp1251, cp866 in examples below). Commandline options ...



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