Loading ...
Sorry, an error occurred while loading the content.
 

Re: [gnubies-il] another reason to use tar

Expand Messages
  • Boaz Rymland
    ... A few useful remarks, IMO: 1. When taring special files like /dev files, dont forget to use the p option to tar. Not doing so will result in a /dev
    Message 1 of 2 , Oct 29, 2000
      stephen s fine wrote:
      >
      > On Sun, 28 May 2000, Alex Shnitman wrote:
      >
      > > > tar cspBf - . | (cd /mnt; tar xvvspBf -)
      > >
      > > Any reason why not to use cp -a that I'm not aware of?
      >
      > in theory you have one process writing and one reading, so in an SMP
      > machine, copying between two different partitions on two different
      > drives on two different controllers, you could have a HUGE speed
      > gain! :-)))
      >

      A few useful remarks, IMO:

      1. When taring special files like /dev files, dont forget to use the "p" option
      to tar. Not doing so will result in a /dev directory with many, too many,
      useless files and countless problems on your machine, from unusable printer to
      non-existing mouse devices - all in one big surprise!... (more info on tar's
      manual page).

      2. Not using the "--exclude" option of tar (or it's similar variants, AFAIK) can
      result, like it resulted to me, in copying a nice file of the kernel image or
      something, under the /proc dir'. This file was a few hundreds megabyte big... So
      it is indeed preferred not to cause yourself such embarrassments, when you need
      that server up, ASAP... :-) (even if your talking about a small home
      machine...).

      3. There is another reason to use this sort of method to copy FS (tar vf - ... |
      tar vf - ...):
      The educational benefit. This is a common method of doing things on Unix.
      Running one command and pouring it's output to a different command's standard
      input via a pipeline, on the fly. One thing possible doing like that is to dump
      complete disk on other empty disk. I cant recall the exact details but I
      remember once I had to copy a SCSI disk and for some reason the only avail'
      option was "dump -f - ...| restore -f - ..." . Learning and using it once
      pushes into one's head that method of performing tasks on Unix.

      Boaz.

      --
      /"\
      \ / ASCII Ribbon Campaign
      x Against HTML Mail
      / \
    Your message has been successfully submitted and would be delivered to recipients shortly.