On Tue, 30 Apr 2002, at 10:58am, Bayard Coolidge USG wrote:
> There are a bazillion switches and the syntax is a bit arcane ...

  While what Bayard says is true, basic usage of tar isn't *that* hard  

  tar --create --file=/dev/tape /thing/to/back/up /another/thing

  Basically, tar takes one "command" switch which tells it what you want to
do.  In the above, the command is "create an archive".  You can add any
number of options, but they are, well, optional.  You will usually want to
specify some non-switch arguments, which specify the files ("things" in the
above) to add to the archive.

  There is one "option" which is practically mandatory.  By default, GNU tar
will expect to write the tar archive to standard output (the terminal).  
You will usually want to use the '--file' switch to tell tar to write to a
particular file or device instead.

  The above example assumes '/dev/tape' exists, presumably as a symbolic
link to your tape device.  Please make sure '/dev/tape' actually *does*
exist before trying that.  Otherwise, you may end up with a large file
called 'tape' in your '/dev/' directory.

  The other commands you are likely to care about are:

  --list
      list contents of the archive
  --extract
      extract contents of the archive
  --compare
      compare contents of archive to filesystem

  Other useful options include:

  --totals
      print a line telling you how many bytes were written and how fast
  --one-file-system
      do not leave the filesystem that each "thing" is stored on
  --gzip
      use the 'gzip' tool to (de)compress the archive

  So, a more complete command might be:

  tar --create --file=/dev/tape --totals --one-file-system / /home

  That creates an archive consisting of the root and "home" filesystems.  
The archive will be written to tape, and totals will be printed on the
screen.  That does assume "home" is a separate partition from the root -- if
not, it will duplicate everything in the '/home' directory branch.

  The GNU tar "info" manual is surprisingly good.  Unfortunately, the 'info'
browser is surprisingly bad.  See if you can find the GNU tar manual on the
web.

  The above examples assume GNU tar.  The 'tar' included with other systems
will likely not work as well, or at all.  The solution is to use the native
'tar' command to unpack the GNU tar sources.  ;-)
  
  Hope this helps,

-- 
Ben Scott <[EMAIL PROTECTED]>
| The opinions expressed in this message are those of the author and do not |
| necessarily represent the views or policy of any other person, entity or  |
| organization.  All information is provided without warranty of any kind.  |


*****************************************************************
To unsubscribe from this list, send mail to [EMAIL PROTECTED]
with the text 'unsubscribe gnhlug' in the message body.
*****************************************************************

Reply via email to