Re: Using the wait function

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 05/29/03


Date: Thu, 29 May 2003 14:33:33 GMT

In article <73fa94c2.0305290555.82af75f@posting.google.com>,
Anne <apembert@hq.nasa.gov> wrote:
>Hello,
>
>I'm using both tar and gzip in a script which also writes to a LOG
>when both
>functions have been done. But it seems that only the tar is getting
>done, and
>not the gzip.
>I'd like to use the "wait" command, but should it be used between the
>two functions, or after such as in the example:
>
> tar -cvf $FILE dumps
> echo "$FILE created" >> $LOG
> gzip $FILE
> wait
> echo "$FILE was gzipped" >> $LOG

The wait command is used to wait for background processes to finish. Since
you aren't running anything in the background in the script, there's no
need for it. The commands in your script are executed sequentially -- each
one starts when the previous one has finished.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.


Relevant Pages

  • Re: Using the wait function
    ... >> I'm using both tar and gzip in a script which also writes to a LOG ... to the directory where the tar/gz file is supposed to be stored and see it's ...
    (comp.unix.admin)
  • Using the wait function
    ... I'm using both tar and gzip in a script which also writes to a LOG ... Anne ...
    (comp.unix.admin)
  • Sub-directories and commands
    ... Perhaps a script would do the job. ... or "gzip *.tar" on all subdirectories, ...
    (comp.unix.questions)
  • Top 10 subjects comp.unix.questions
    ... posts kbytes subject ... 15 25.5 how to write the following script ... 5.9 gzip error on tar file 8GB ...
    (comp.unix.questions)
  • tar or dump and restore commands on Compaq Tru64 UNIX or Unix - restore from tape?
    ... They have a script I assume that runs a backup tape every night of just one ... So no idea if they are using tar or dump. ... assuming their either are using a tar or dump command / script. ... a restore from a tar file assuming they are using tar. ...
    (comp.unix.admin)