| Author |
GNUtar doesn't fit my needs...
|
|
| Jean-Luc BEAUDET 2004-01-23, 4:54 pm |
| 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 :-)
| |
| rakesh sharma 2004-01-23, 4:54 pm |
| Jean-Luc BEAUDET <beaudet@cyber.kodak.com> wrote in message news:<3FBB4A10.9080200@cyber.kodak.com>...quote:
> 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 2004-01-23, 4:54 pm |
| 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:
quote:
>Jean-Luc BEAUDET <beaudet@cyber.kodak.com> wrote in message news:<3FBB4A10.9080200@cyber.kodak.com>...
>
>
>use in the exclude file:
>subdir1/
>
>instead of,
>my/main/dir/subdir1/*
>
| |
| Michael Wang 2004-01-23, 4:54 pm |
| In article <3FBB4A10.9080200@cyber.kodak.com>,
Jean-Luc BEAUDET <beaudet@cyber.kodak.com> wrote:quote:
>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 * http://www.unixlabplus.com/ * mwang@unixlabplus.com
| |
| Michael Zawrotny 2004-01-23, 4:54 pm |
| Jean-Luc BEAUDET <beaudet@cyber.kodak.com> wrote:quote:
> 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: zawrotny@sb.fsu.edu
Tallahassee, FL 32306-4380 | phone: (850) 644-0069
|
|
|
|