|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
|
Re: [PLUG] TAR command line question
|
On 19 Apr 2001 13:30:43 -0400, Jeff Abrahamson wrote:
> 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 /
Yes, sorry for that oversight; I wanted the syntax to be clear in the
msg (CAPS are easier to read), not realising that it was actually
incorrect in the end.
>
> 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 /)
I'm beginning to see this, it's still a bit confusing though!
If we take command line --- tar c v f b /dev/tape 20 /
(spaced out for clarity)
and we pair off the 1 2 1 2
modifiers with args -
So, tar's "c" and "v" switches have no args, and the "/" arg has no
switch or modifier.
The only switches that need args are the "f" and "b" switches.
Am I starting to understand this??
>
> 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.
That part is very interesting, I kinda like that approach, very visibly
"unconfusing", except you left out the source to archive (an ending
"/"?) !!
Thanks for your time to reply!
--
regs
rupert
______________________________________________________________________
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
|
|