Jeff Abrahamson on Thu, 19 Apr 2001 13:50:12 -0400


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] TAR command line question


On Thu, Apr 19, 2001 at 10:50:41AM -0400, Rupert Heesom wrote:
> In my LPIC studies, the command line of "TAR CVFB /DEV/TAPE 20 /" is
> supposed to be correct because the order of the modifiers are the same
> as the arguments.
> 
> Now, when I look at the command line,  assuming that the modifier "C"
> correlates to "/dev/tape", "F" to "/" and "B" to "20", I think that the
> arguments should be in the order of "/dev/tape / 20".
> 
> Am I wrong?

On several counts, I'm afraid.

First, unix is case sensitive, so I presume you mean

       tar cvfb /dev/tape 20 /

Now, assuming that's what you mean, you can see in tar(1) that

     c	      means create a new archive
     v	      means verbose (echo names as they are added to archive)
     f	      file name of archive, so /dev/tape
     b	      blocking factor, so 20

and then any further arguments are the files to archive, in this case
/.

As long as you are using gnu tar, it will warn you that it is
stripping the leading / from the name. To be safe and proper, though,
you should cd to / and archive .

    (cd / && tar cvfb /dev/tape 20 /)

This way if you want to restore some day, you can choose where to
restore to. This is important.

You can also use long option names, allowing you to say

    tar --create --verbose --file=/dev/tape --blocking-factor=20

which might be clearer in a script.

-- 
 Jeff

 Jeff Abrahamson  <http://www.purple.com/jeff/>



______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug