New answers tagged

1

You should use the tar --numeric-owner option. The files in the archive were created using the /etc/passwd file that's in the archive. There's a good chance that users and groups exist in the archive that don't exist on the Live DVD image because packages can create users and/or groups when installed and configured). Even if you ran the same Live DVD each ...


1

This the command you will need: find . -type d -print0 | tar cf folderstructure.tar --null --files-from - --no-recursion it generates the file folderstructure.tar with the folder structure without the files.


0

Use cpio, not tar for this. First, cd to the top level directory you want to copy. find . -type d -print0 | cpio -o -0 >/tmp/archive.cpio Then copy /tmp/archive.cpio to your remote host. You can do it in one step: find . -type d -print0 | cpio -o -0 | ssh user@remotehost "cd targetdir; cpio -i" By the way, the -print0 and -0 options are ...


1

If You are using MAC OS It turns out this is just an issue with tar files created on Mac OS X. Mac OS X uses BSD tar and creates some extra info that is not recognized by GNU tar. Solution: Don’t Worry About It What should you do about this? You don’t need to do anything. Your files will be extracted correctly, so you can safely ignore these warnings or ...


1

The other answers on here are great, but I wanted to create a completely automated installation script. I hope this helps someone. #!/bin/bash sudo apt-get install -y cmake yasm libjpeg-dev libsdl-image1.2-dev libsdl1.2-dev pushd /tmp wget -O libpng-1.6.21.tar.xz ...


3

GNU tar's --index-file option works well: tar cvf - ./foo 2>foo.err --index-file=foo.out | squish > foo.tar.S


3

Tape devices under Unix are a bit unique in that they are record-oriented rather than being a stream of bytes. So each record written to tape must be a round multiple of some block size, usually 512 bytes, and must be done in a single write call. Each tape device will have lower and upper bounds for the record size. Similarly, you have to read a record in a ...


2

This is pretty interesting: a wrong block size using the dd command also generates an out of memory error. Using 'dd' (disk dump) to verify Tivoli Storage Manager tape volume labels To view or change the block size on a tape drive, you could use: lsattr -El rmt0 -a block_size And to change it, for example to variable, chdev -l rmt0 -a block_size=0 ...


3

My first time here. I wonder whether you can list the files without attempting a restore just yet. You could try doing that with tar -tvf /dev/rmt0 And also, is it possible that you could capture the output to a file rather than to STDOUT (your screen)? tar -tvf /dev/rmt0 1>/tmp/rest.out 2>/tmp/rest.err A couple of other areas to look at. Is it ...


0

So long story short, this is the best way I have found to achieve this, in case someone else is interested: find /mnt* -type d -name snapshots > dir.list; \ tar -czpf - -T dir.list | ssh user@host "openssl aes256 \ -out /mntc/backups/snapshot.tgz.enc -salt -k 'secret'"


1

You need to treat /dev/sdb2 as either a raw partition or as a filesystem, not as both. It appears as though you created a filesystem on it at one point and mounted it at /media/ravi, but as soon as you piped tar or cpio output directly to /dev/sdb2, you ruined the filesystem. Either write to a file on the filesystem, or treat it as a raw device that you do ...


0

You should use the --confirmation option from the tar command. For example: $> tar xvf --confirmation x.tar.gz


0

Yes it (at least the tar program) will overwrite existing files (it won't append anything): $ mkdir x $ echo hello >x/file $ tar cvfz x.tar.gz x x/ x/file $ echo world >x/file $ tar xvfz x.tar.gz x/ x/file $ cat x/file hello Since you've rewrote your question the answer is that the existing files .htaccess, a.html, b.html, c.html will be replaced ...


0

The -z option is not required in two well-known implementations of tar: GNU tar and BSD tar (aka libarchive). Detecting the compression algorithm needed is trivial, done by inspecting the first few bytes of the input file. Whether you happen to be using one or the other of those implementations largely depends upon which operating system you are using: ...



Top 50 recent answers are included