Professional Web Applications Themes

GNUtar doesn't fit my needs... - Linux / Unix Administration

Hi all, Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole dir BUT one subdir. Assuming the following /my/main/dir/subdir1 ...................../subdir2 ...................../subdir3 ...................../subdir4 I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1 I tried # tar -c -v -z -P -f /tmp/backup.tgz -X /tmp/exclude.tar /my/main/dir -P to keep leading "/" -X pointing to the file containing the files to exclude # cat /tmp/exclude.tar /my/main/dir/subdir1/* # The command achieve with no errors, but subdir1 and all included in keep on archiving !!! I tried modifying the content of /tmp/exclude.tar as my/main/dir/* - that is no leading / ...

  1. #1

    Default GNUtar doesn't fit my needs...

    Hi all,

    Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole
    dir BUT one subdir.

    Assuming the following

    /my/main/dir/subdir1
    ...................../subdir2
    ...................../subdir3
    ...................../subdir4

    I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1

    I tried
    # tar -c -v -z -P -f /tmp/backup.tgz -X /tmp/exclude.tar /my/main/dir

    -P to keep leading "/"
    -X pointing to the file containing the files to exclude
    # cat /tmp/exclude.tar
    /my/main/dir/subdir1/*
    #

    The command achieve with no errors, but subdir1 and all included in keep
    on archiving !!!

    I tried modifying the content of /tmp/exclude.tar as
    my/main/dir/* - that is no leading / -
    BUT the result is the same.

    Any help welcome.

    JLB :-)



    Jean-Luc BEAUDET Guest

  2. #2

    Default Re: GNUtar doesn't fit my needs...

    Jean-Luc BEAUDET <beaudetcyber.kodak.com> wrote in message news:<3FBB4A10.9080200cyber.kodak.com>...
    > Hi all,
    >
    > Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole
    > dir BUT one subdir.
    >
    > Assuming the following
    >
    > /my/main/dir/subdir1
    > ..................../subdir2
    > ..................../subdir3
    > ..................../subdir4
    >
    > I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1
    >
    > I tried
    > # tar -c -v -z -P -f /tmp/backup.tgz -X /tmp/exclude.tar /my/main/dir
    >
    > -P to keep leading "/"
    > -X pointing to the file containing the files to exclude
    > # cat /tmp/exclude.tar
    > /my/main/dir/subdir1/*
    > #
    >
    > The command achieve with no errors, but subdir1 and all included in keep
    > on archiving !!!
    >
    > I tried modifying the content of /tmp/exclude.tar as
    > my/main/dir/* - that is no leading / -
    > BUT the result is the same.
    >
    > Any help welcome.
    >
    > JLB :-)
    use in the exclude file:
    subdir1/

    instead of,
    my/main/dir/subdir1/*
    rakesh sharma Guest

  3. #3

    Default Re: GNUtar doesn't fit my needs...

    Thank you for the trick, rakesh.

    But subdir1/ doesn't do the trick as subdir does !

    I'm not sure to well understand...

    Regards.

    JLB :-)

    rakesh sharma wrote:
    >Jean-Luc BEAUDET <beaudetcyber.kodak.com> wrote in message news:<3FBB4A10.9080200cyber.kodak.com>...
    >
    >>Hi all,
    >>
    >>Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole
    >>dir BUT one subdir.
    >>
    >>Assuming the following
    >>
    >>/my/main/dir/subdir1
    >>..................../subdir2
    >>..................../subdir3
    >>..................../subdir4
    >>
    >>I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1
    >>
    >>I tried
    >># tar -c -v -z -P -f /tmp/backup.tgz -X /tmp/exclude.tar /my/main/dir
    >>
    >>-P to keep leading "/"
    >>-X pointing to the file containing the files to exclude
    >># cat /tmp/exclude.tar
    >>/my/main/dir/subdir1/*
    >>#
    >>
    >>The command achieve with no errors, but subdir1 and all included in keep
    >>on archiving !!!
    >>
    >>I tried modifying the content of /tmp/exclude.tar as
    >>my/main/dir/* - that is no leading / -
    >>BUT the result is the same.
    >>
    >>Any help welcome.
    >>
    >>JLB :-)
    >>
    >
    >use in the exclude file:
    >subdir1/
    >
    >instead of,
    >my/main/dir/subdir1/*
    >

    Jean-Luc BEAUDET Guest

  4. #4

    Default Re: GNUtar doesn't fit my needs...

    In article <3FBB4A10.9080200cyber.kodak.com>,
    Jean-Luc BEAUDET <beaudetcyber.kodak.com> wrote:
    >Hi all,
    >
    >Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole
    >dir BUT one subdir.
    >
    >Assuming the following
    >
    >/my/main/dir/subdir1
    >..................../subdir2
    >..................../subdir3
    >..................../subdir4
    >
    >I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1
    Jean-Luc,

    Can you use "find" to list "/my/main/dir with all subdirs BUT subdir1"?
    Yes? good. Then you can pipe the list to tar:

    find ... | tar ... --files-from=-

    Hope this helps.
    --
    Michael Wang * [url]http://www.unixlabplus.com/[/url] * [email]mwangunixlabplus.com[/email]
    Michael Wang Guest

  5. #5

    Default Re: GNUtar doesn't fit my needs...

    Jean-Luc BEAUDET <beaudetcyber.kodak.com> wrote:
    > Working under SOLARIS 5.6 i'm trying to GNUtar the content of a whole
    > dir BUT one subdir.
    >
    > Assuming the following
    >
    > /my/main/dir/subdir1
    > ..................../subdir2
    > ..................../subdir3
    > ..................../subdir4
    >
    > I'd like to GNUtar /my/main/dir with all subdirs BUT subdir1
    >
    > I tried
    > # tar -c -v -z -P -f /tmp/backup.tgz -X /tmp/exclude.tar /my/main/dir
    Did you try

    tar -c -v -z -P -f /tmp/backup.tgz --exclude=/my/main/dir/subdir1 \
    /my/main/dir

    It works for me.


    Mike

    --
    Michael Zawrotny
    Institute of Molecular Biophysics
    Florida State University | email: [email]zawrotnysb.fsu.edu[/email]
    Tallahassee, FL 32306-4380 | phone: (850) 644-0069
    Michael Zawrotny Guest

Similar Threads

  1. Replies: 0
    Last Post: September 8th, 10:15 PM
  2. Replies: 0
    Last Post: September 8th, 10:15 PM
  3. Replies: 0
    Last Post: September 8th, 08:59 PM
  4. Replies: 0
    Last Post: September 8th, 08:49 PM
  5. it doesn't add up
    By hec_TX webforumsuser@macromedia.com in forum Macromedia Flash Actionscript
    Replies: 2
    Last Post: January 13th, 11:24 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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