Re: tar help

From: Doug Freyburger (dfreybur_at_yahoo.com)
Date: 11/25/03


Date: 25 Nov 2003 08:46:59 -0800

Hinet_news wrote:
>
> How to use tar to limit some kinds of file ?
...
> tar the dir and it;s sub dir /home/user/ll
> but not include all *.ff files or
> not include directory aa ?

"Help, I'm using the wrong tool for the job and it is not
doing what I want. I only know tar, and when the only tool
you have is a hammer, every problem looks like a nail."

Your solution isn't to keep beating on tar until it sort
of behaves like what you want. Remember the Unix philosophy.
Lots of small tools that do one thing well. Link them
together with pipes.

You have two separate problems you're trying to merge into
one. Don't. Let them be separate.

Use find to generate the list of files you want backed up.
It specializes in that, so use it for that.

Use cpio, pax or similar to produce backups. Find produces
standard output and they use standard input, very convenient
that. If pax is available you can even have it produce tar
formatted outout.



Relevant Pages

  • Re: ksh help: redirect standard error
    ... I try to capture all the errors from tar command, NOT standard output. ...
    (comp.unix.shell)
  • Re: tar help
    ... I only know tar, ... > standard output and they use standard input, ... What about the restriction with various versions of cpio and the maximum ... DeeDee, don't press that button! ...
    (comp.unix.admin)
  • Re: ** I/O performance for backup - tar , rsync , cp on FreeBSD **
    ... space on the destination for an untar afterwards? ... The way I learned years ago was to use back-to-back tar... ... standard output of one into standard input of the other. ... there's still the small file handling. ...
    (comp.unix.bsd.freebsd.misc)
  • Re: ** I/O performance for backup - tar , rsync , cp on FreeBSD **
    ... The way I learned years ago was to use back-to-back tar... ... standard output of one into standard input of the other. ... there's still the small file handling. ... You might try pax or cpio and see if they work better; ...
    (comp.unix.bsd.freebsd.misc)
  • Re: creating multi volume tar files .tar1, .tar2 etc
    ... tar would do something intelligently. ... > Can someone tell me a way that i can tar up (tar, zip, compress i dont ... Hi Ian, ... The -O option to tar says to send the archive to the standard output. ...
    (RedHat)