bug-tar
[Top][All Lists]
Advanced

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

Re: [Bug-tar] (no subject)


From: Jan-Benedict Glaw
Subject: Re: [Bug-tar] (no subject)
Date: Sat, 22 Mar 2008 18:15:56 +0100
User-agent: Mutt/1.5.13 (2006-08-11)

On Sat, 2008-03-22 12:18:00 -0000, Andrew <address@hidden> wrote:
> Running RedHat 7.2

Stoneage!

> I had a tar script with the following lines.
> 
> #!/bin/sh 
> # 
> ls -R scripttest
> tar -cvf scripttest > scripttest.tar 
> ls -l 
> #

What is this script ment to do? Backup the file "scripttest" to a
tarball called "scripttest.tar"? If so, then it's wrong.

tar -cvf - scripttest > scripttest.tar

would have done the job. Notice that "f" implies supplying a filename
where to write the tarball to. (With "-" being stdout, as usual.) You
also always have to supply at least one entity that should be backed
up.

> It would only produce a tar of zero bytes 

Correct. Because tar doesn't know what to do except exiting early with
an error message.

> Error Message: tar: Cowardly refusing to create an empty archive

Correct. You didn't supply anything that should go into the backup.
Just because in your above example, "scripttest" would have been the
output file.

> I eventually  ommitted the f from the cvf and it worked

Sure.

> I know that the cvf should work as seen in this example :
> 
> Host% tar -cvf $RMT -C ~joe . -C /sm4/joe/ .
> 
> From:
> https://www.washington.edu/computing/unix/tar.html
> 
> Is this a bug, or is my script wrong?

Your script is wrong. Depending on what you actually want to achieve,
you're either omitting the output filename, or the list of entities
being backed up.

MfG, JBG

-- 
      Jan-Benedict Glaw      address@hidden              +49-172-7608481
 Signature of:                      http://perl.plover.com/Questions.html
 the second  :

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]