On Sat, 2008-03-22 12:18:00 -0000, Andrew <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] +49-172-7608481 Signature of: http://perl.plover.com/Questions.html the second :
signature.asc
Description: Digital signature
