Alex Antener <[email protected]> ha escrit:

> ... which means, that the command
> 
> > tar -C ~/foobar -czf foobar.tar.gz ~/foobar/*.sql
> 
> works.

Sure it works, but there's no real sense in the -C option in this case.

> Do I really have to
> 
> > cd ~/foobar

Not necessarily. The usual recipe is either

 (cd ~/foobar; find -name '*.sql' -maxdepth 1 | tar czfT - -) > foobar.tar.gz

or

 find ~/foobar -name '*.sql' -maxdepth 1 -printf "%f\n" | \
   tar CczfT ~/foobar foobar.tar.gz -
 
Regards,
Sergey

Reply via email to