Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default tar question

    I have the following...
    rgdb
    with...
    db1
    db2
    db3
    db4
    db5
    Within the rgdb directory.
    I want to tar all that is under the rgdb directory (recursive) but not the
    db5 directory. This is where I want to put the tar file.
    I want to run this from a script.

    I did not see any examples in the man pages. And I cant seem to get an
    handle around this one...
    Any help..



    LHradowy Guest

  2. Similar Questions and Discussions

    1. Newbie Question: Biz Card Template Question
      Hi, I got the Pagemaker PlugIn - I am using one of the templates for Business Cards - the elements appear to be grouped (bound box all around when I...
  3. #2

    Default tar question

    I have the following...
    rgdb
    with...
    db1
    db2
    db3
    db4
    db5
    Within the rgdb directory.
    I want to tar all that is under the rgdb directory (recursive) but not the
    db5 directory. This is where I want to put the tar file.
    I want to run this from a script.

    I did not see any examples in the man pages. And I cant seem to get an
    handle around this one...
    Any help..



    LHradowy Guest

  4. #3

    Default Re: tar question

    In article <AFmOa.6378$V8.3982@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >I have the following...
    >rgdb
    >with...
    >db1
    >db2
    >db3
    >db4
    >db5
    >Within the rgdb directory.
    >I want to tar all that is under the rgdb directory (recursive) but not the
    >db5 directory. This is where I want to put the tar file.
    >I want to run this from a script.
    tar cf db5/file.tar db1 db2 db3 db4

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    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.
    Barry Margolin Guest

  5. #4

    Default Re: tar question

    In article <AFmOa.6378$V8.3982@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >I have the following...
    >rgdb
    >with...
    >db1
    >db2
    >db3
    >db4
    >db5
    >Within the rgdb directory.
    >I want to tar all that is under the rgdb directory (recursive) but not the
    >db5 directory. This is where I want to put the tar file.
    >I want to run this from a script.
    tar cf db5/file.tar db1 db2 db3 db4

    --
    Barry Margolin, [email]barry.margolin@level3.com[/email]
    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.
    Barry Margolin Guest

  6. #5

    Default Re: tar question

    In comp.unix.misc LHradowy <laura.hradowy@nospam.mts.ca> wrote:
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    Well, just use some basic Unix shell lines:
    tar cf rgdb/db5/bla.tar `ls -d rgdb/*/. | grep -v rgdb/db5/`
    .... or so.


    - Hubert

    --
    Want to get a clue on IPv6 but don't know where to start? Try this:
    * Basics -> [url]http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html[/url]
    * Setup -> [url]http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html[/url]
    Of course with your #1 IPv6 ready operating system -> [url]http://www.NetBSD.org/[/url]
    Hubert Feyrer Guest

  7. #6

    Default Re: tar question

    In comp.unix.misc LHradowy <laura.hradowy@nospam.mts.ca> wrote:
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    Well, just use some basic Unix shell lines:
    tar cf rgdb/db5/bla.tar `ls -d rgdb/*/. | grep -v rgdb/db5/`
    .... or so.


    - Hubert

    --
    Want to get a clue on IPv6 but don't know where to start? Try this:
    * Basics -> [url]http://www.onlamp.com/pub/a/onlamp/2001/05/24/ipv6_tutorial.html[/url]
    * Setup -> [url]http://www.onlamp.com/pub/a/onlamp/2001/06/01/ipv6_tutorial.html[/url]
    Of course with your #1 IPv6 ready operating system -> [url]http://www.NetBSD.org/[/url]
    Hubert Feyrer Guest

  8. #7

    Default Re: tar question

    LHradowy wrote:
    >
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    tar cvf repository ./rgdb/db1 ./rgdb/db2 ./rgdb/db3 ./rgdb/db4

    --
    Fletcher Glenn
    email [email]f-g-l-e-n-n@quest.com[/email] (remove the dashes)
    Fletcher Glenn Guest

  9. #8

    Default Re: tar question

    LHradowy wrote:
    >
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    tar cvf repository ./rgdb/db1 ./rgdb/db2 ./rgdb/db3 ./rgdb/db4

    --
    Fletcher Glenn
    email [email]f-g-l-e-n-n@quest.com[/email] (remove the dashes)
    Fletcher Glenn Guest

  10. #9

    Default Re: tar question

    In article <AFmOa.6378$V8.3982@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >I have the following...
    >rgdb
    >with...
    >db1
    >db2
    >db3
    >db4
    >db5
    >Within the rgdb directory.
    >I want to tar all that is under the rgdb directory (recursive) but not the
    >db5 directory. This is where I want to put the tar file.
    >I want to run this from a script.
    star -c -V pat=db5* -C rgdb . > /tmp/somfile.tar

    [url]ftp://ftp.berlios.de/pub/star[/url]

    [url]http://www.blastwave.org/packages.php[/url]

    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

  11. #10

    Default Re: tar question

    In article <AFmOa.6378$V8.3982@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >I have the following...
    >rgdb
    >with...
    >db1
    >db2
    >db3
    >db4
    >db5
    >Within the rgdb directory.
    >I want to tar all that is under the rgdb directory (recursive) but not the
    >db5 directory. This is where I want to put the tar file.
    >I want to run this from a script.
    star -c -V pat=db5* -C rgdb . > /tmp/somfile.tar

    [url]ftp://ftp.berlios.de/pub/star[/url]

    [url]http://www.blastwave.org/packages.php[/url]

    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

  12. #11

    Default Re: tar question

    In article <becvv4$3nlsq$1@ID-180809.news.dfncis.de>,
    Hubert Feyrer <hubert@feyrer.de> wrote:
    >In comp.unix.misc LHradowy <laura.hradowy@nospam.mts.ca> wrote:
    >> I have the following...
    >> rgdb
    >> with...
    >> db1
    >> db2
    >> db3
    >> db4
    >> db5
    >> Within the rgdb directory.
    >> I want to tar all that is under the rgdb directory (recursive) but not the
    >> db5 directory. This is where I want to put the tar file.
    >> I want to run this from a script.
    >>
    >> I did not see any examples in the man pages. And I cant seem to get an
    >> handle around this one...
    >
    >Well, just use some basic Unix shell lines:
    >tar cf rgdb/db5/bla.tar `ls -d rgdb/*/. | grep -v rgdb/db5/`
    >... or so.
    Sounds prone to problems.....

    If the only reason for excluding the directory db5, is to avoid that the
    tar archive becomes part of itself, just use star. Star will detect the
    archive and auto-exclude it from the list of files that go into the archive:

    star -c f=db5/xx.tar .

    [url]ftp://ftp.berlios.de/pub/star[/url]

    [url]http://www.blastwave.org/packages.php[/url]

    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

  13. #12

    Default Re: tar question

    In article <becvv4$3nlsq$1@ID-180809.news.dfncis.de>,
    Hubert Feyrer <hubert@feyrer.de> wrote:
    >In comp.unix.misc LHradowy <laura.hradowy@nospam.mts.ca> wrote:
    >> I have the following...
    >> rgdb
    >> with...
    >> db1
    >> db2
    >> db3
    >> db4
    >> db5
    >> Within the rgdb directory.
    >> I want to tar all that is under the rgdb directory (recursive) but not the
    >> db5 directory. This is where I want to put the tar file.
    >> I want to run this from a script.
    >>
    >> I did not see any examples in the man pages. And I cant seem to get an
    >> handle around this one...
    >
    >Well, just use some basic Unix shell lines:
    >tar cf rgdb/db5/bla.tar `ls -d rgdb/*/. | grep -v rgdb/db5/`
    >... or so.
    Sounds prone to problems.....

    If the only reason for excluding the directory db5, is to avoid that the
    tar archive becomes part of itself, just use star. Star will detect the
    archive and auto-exclude it from the list of files that go into the archive:

    star -c f=db5/xx.tar .

    [url]ftp://ftp.berlios.de/pub/star[/url]

    [url]http://www.blastwave.org/packages.php[/url]

    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

  14. #13

    Default Re: tar question

    Hallo,

    I would use the fillowing commands:

    $ echo rgdb/db5 >/tmp/exclude.$$
    $ tar cXf /tmp/exclude.$$ rgdb/db5/dump.tar rgdb
    $ rm -f /tmp/exclude.$$

    With the X parameter, you can define a file containing all the names of
    files and directories that have to be excluded from the tar file (see the
    manual pages).

    Vincent


    "LHradowy" <laura.hradowy@NOSPAM.mts.ca> wrote in message
    news:AFmOa.6378$V8.3982@news1.mts.net...
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    >
    >
    >
    Vincent Smeets Guest

  15. #14

    Default Re: tar question

    Hallo,

    I would use the fillowing commands:

    $ echo rgdb/db5 >/tmp/exclude.$$
    $ tar cXf /tmp/exclude.$$ rgdb/db5/dump.tar rgdb
    $ rm -f /tmp/exclude.$$

    With the X parameter, you can define a file containing all the names of
    files and directories that have to be excluded from the tar file (see the
    manual pages).

    Vincent


    "LHradowy" <laura.hradowy@NOSPAM.mts.ca> wrote in message
    news:AFmOa.6378$V8.3982@news1.mts.net...
    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    >
    >
    >
    Vincent Smeets Guest

  16. #15

    Default Re: tar question

    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    How would I compress it at the same time, when I try to do a tar zcvf, it
    does not recognize the -z option...


    LHradowy Guest

  17. #16

    Default Re: tar question

    > I have the following...
    > rgdb
    > with...
    > db1
    > db2
    > db3
    > db4
    > db5
    > Within the rgdb directory.
    > I want to tar all that is under the rgdb directory (recursive) but not the
    > db5 directory. This is where I want to put the tar file.
    > I want to run this from a script.
    >
    > I did not see any examples in the man pages. And I cant seem to get an
    > handle around this one...
    > Any help..
    How would I compress it at the same time, when I try to do a tar zcvf, it
    does not recognize the -z option...


    LHradowy Guest

  18. #17

    Default Re: tar question

    In article <LzBOa.8114$V8.5450@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >How would I compress it at the same time, when I try to do a tar zcvf, it
    >does not recognize the -z option...
    The -z option is only recognised by GNU tar or star

    [url]ftp://ftp.berlios.de/pub/star[/url]
    [url]http://www.blastwave.org/packages.php[/url]


    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

  19. #18

    Default Re: tar question

    In article <LzBOa.8114$V8.5450@news1.mts.net>,
    LHradowy <laura.hradowy@NOSPAM.mts.ca> wrote:
    >How would I compress it at the same time, when I try to do a tar zcvf, it
    >does not recognize the -z option...
    The -z option is only recognised by GNU tar or star

    [url]ftp://ftp.berlios.de/pub/star[/url]
    [url]http://www.blastwave.org/packages.php[/url]


    --
    EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
    [email]js@cs.tu-berlin.de[/email] (uni) If you don't have iso-8859-1
    [email]schilling@fokus.fraunhofer.de[/email] (work) chars I am J"org Schilling
    URL: [url]http://www.fokus.fraunhofer.de/usr/schilling[/url] [url]ftp://ftp.berlios.de/pub/schily[/url]
    Joerg Schilling Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139